diff --git a/.conf/desktop/lxde/lxde-rc.xml b/.conf/desktop/lxde/lxde-rc.xml
index ae27f0b160..db537bb60b 100644
--- a/.conf/desktop/lxde/lxde-rc.xml
+++ b/.conf/desktop/lxde/lxde-rc.xml
@@ -671,7 +671,6 @@
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
-
# each element can be left out or set to 'default' to specify to not
# change that attribute of the window
diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf
index d7337c9267..4010b05ffc 100644
--- a/.conf/dps_114/lighttpd.nextcloud.conf
+++ b/.conf/dps_114/lighttpd.nextcloud.conf
@@ -18,15 +18,16 @@ $HTTP["url"] =~ "^/nextcloud($|/)" {
# - Directory listing
dir-listing.activate = "disable"
# - Cache control and security headers for static resources
- $HTTP["url"] =~ "^/nextcloud/.*\.(css|js|woff2?|svg|gif)$" {
+ $HTTP["url"] =~ "^/nextcloud/.+[^/]\.(css|js|woff2?|svg|gif|map)$" {
setenv.add-response-header += (
"Cache-Control" => "public, max-age=15778463",
+ "Referrer-Policy" => "no-referrer",
"X-Content-Type-Options" => "nosniff",
- "X-XSS-Protection" => "1; mode=block",
- "X-Robots-Tag" => "none",
"X-Download-Options" => "noopen",
+ "X-Frame-Options" => "SAMEORIGIN",
"X-Permitted-Cross-Domain-Policies" => "none",
- "Referrer-Policy" => "no-referrer",
+ "X-Robots-Tag" => "none",
+ "X-XSS-Protection" => "1; mode=block",
)
}
diff --git a/.conf/dps_114/nginx.nextcloud.conf b/.conf/dps_114/nginx.nextcloud.conf
index b9081fac72..114d7f898e 100644
--- a/.conf/dps_114/nginx.nextcloud.conf
+++ b/.conf/dps_114/nginx.nextcloud.conf
@@ -8,13 +8,13 @@ location ~ ^\/(?:ocm-provider|ocs-provider).* {
location ^~ /nextcloud {
# Add headers to serve security related headers
- #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;";
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Robots-Tag none;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- add_header Referrer-Policy no-referrer;
+ add_header Referrer-Policy "no-referrer" always;
+ add_header X-Content-Type-Options "nosniff" always;
+ add_header X-Download-Options "noopen" always;
+ add_header X-Frame-Options "SAMEORIGIN" always;
+ add_header X-Permitted-Cross-Domain-Policies "none" always;
+ add_header X-Robots-Tag "none" always;
+ add_header X-XSS-Protection "1; mode=block" always;
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;
@@ -46,7 +46,7 @@ location ^~ /nextcloud {
deny all;
}
- location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|ocs-provider\/.+|ocm-provider\/.+)\.php(?:$|\/) {
+ location ~ ^\/nextcloud\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
@@ -58,29 +58,28 @@ location ^~ /nextcloud {
fastcgi_param front_controller_active true;
fastcgi_pass php;
fastcgi_intercept_errors on;
- # Disable on Jessie, because Jessie Nginx does not support this directive
- #fastcgi_request_buffering off;
+ fastcgi_request_buffering off;
}
- location ~ ^\/nextcloud\/(?:updater|ocs-provider|ocm-provider)(?:$|\/) {
+ location ~ ^\/nextcloud\/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
- location ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif)$ {
+ location ~ ^\/nextcloud\/.+[^\/]\.(?:css|js|woff2?|svg|gif|map)$ {
try_files $uri /nextcloud/index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended
# to have those duplicated to the ones above)
- #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;";
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Robots-Tag none;
- add_header X-Download-Options noopen;
- add_header X-Permitted-Cross-Domain-Policies none;
- add_header Referrer-Policy no-referrer;
+ add_header Referrer-Policy "no-referrer" always;
+ add_header X-Content-Type-Options "nosniff" always;
+ add_header X-Download-Options "noopen" always;
+ add_header X-Frame-Options "SAMEORIGIN" always;
+ add_header X-Permitted-Cross-Domain-Policies "none" always;
+ add_header X-Robots-Tag "none" always;
+ add_header X-XSS-Protection "1; mode=block" always;
# Optional: Don't log access to assets
access_log off;
diff --git a/.conf/dps_47/nginx.owncloud.conf b/.conf/dps_47/nginx.owncloud.conf
index 160501c915..960e83df66 100644
--- a/.conf/dps_47/nginx.owncloud.conf
+++ b/.conf/dps_47/nginx.owncloud.conf
@@ -59,7 +59,7 @@ location ^~ /owncloud {
fastcgi_read_timeout 180; # increase default timeout e.g. for long running carddav/ caldav syncs with 1000+ entries
fastcgi_pass php;
fastcgi_intercept_errors on;
- #fastcgi_request_buffering off; #Available since NGINX 1.7.11
+ fastcgi_request_buffering off;
}
location ~ ^/owncloud/(?:updater|ocs-provider)(?:$|/) {
diff --git a/.conf/dps_6/xorg_asustb.conf b/.conf/dps_6/xorg_asustb.conf
index 806419f7a1..377be5c559 100644
--- a/.conf/dps_6/xorg_asustb.conf
+++ b/.conf/dps_6/xorg_asustb.conf
@@ -1,20 +1,23 @@
-Section "Device"
+# DietPi X.org config
+# All credits go to Rockchip: https://github.com/rockchip-linux/rk-rootfs-build/blob/master/overlay/etc/X11/xorg.conf.d/20-modesetting.conf
+Section "Device"
Identifier "Rockchip Graphics"
Driver "modesetting"
- Option "AccelMethod" "glamor"
+ Option "AccelMethod" "exa"
+# Option "AccelMethod" "glamor"
Option "DRI" "2"
-
+ Option "FlipFB" "always"
EndSection
-Section "Screen"
-
- Identifier "Default Screen"
- SubSection "Display"
-
- Depth 24
- Modes "1920x1080" "1280x1024" "1024x768" "800x600"
-
- EndSubSection
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Rockchip Graphics"
+ Monitor "Default Monitor"
+EndSection
+### Valid values for rotation are "normal", "left", "right"
+Section "Monitor"
+ Identifier "Default Monitor"
+ Option "Rotate" "normal"
EndSection
diff --git a/.conf/dps_6/xorg_c1.conf b/.conf/dps_6/xorg_c1.conf
deleted file mode 100644
index 32d5850b0f..0000000000
--- a/.conf/dps_6/xorg_c1.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-# X.Org X server configuration file for xfree86-video-mali
-
-Section "Device"
- Identifier "Mali-Fbdev"
- Driver "mali"
- Option "fbdev" "/dev/fb0"
- Option "DRI2" "true"
- Option "DRI2_PAGE_FLIP" "false"
- Option "DRI2_WAIT_VSYNC" "false"
- Option "UMP_CACHED" "true"
- Option "UMP_LOCK" "false"
- Option "SWCursor" "false"
- Option "HWCursor" "true"
-
-EndSection
-
-Section "ServerFlags"
- Option "NoTrapSignals" "true"
- Option "DontZap" "false"
- Option "BlankTime" "0"
- Option "StandbyTime" "0"
- Option "SuspendTime" "0"
- Option "OffTime" "0"
-EndSection
-
-Section "DRI"
- Mode 0666
-EndSection
diff --git a/.conf/dps_6/xorg_c2.conf b/.conf/dps_6/xorg_c2.conf
index 3b03382de7..997247df61 100644
--- a/.conf/dps_6/xorg_c2.conf
+++ b/.conf/dps_6/xorg_c2.conf
@@ -1,9 +1,9 @@
+# Provided by @Meveric's setup-odroid: http://fuzon.co.uk/meveric/pool/main/s/setup-odroid/
Section "Device"
+ Identifier "FBTURBO"
+ Driver "fbturbo"
+ Option "fbdev" "/dev/fb0"
- Identifier "FBTurbo"
- Driver "fbturbo"
- Option "fbdev" "/dev/fb0"
- Option "SwapbuffersWait" "true"
- #Option "Rotate" "CCW"
-
+ Option "SwapbuffersWait" "true"
+ Option "alpha_swap" "true"
EndSection
diff --git a/.conf/dps_6/xorg_rk3399.conf b/.conf/dps_6/xorg_rk3399.conf
index 6d5af3e616..377be5c559 100644
--- a/.conf/dps_6/xorg_rk3399.conf
+++ b/.conf/dps_6/xorg_rk3399.conf
@@ -1,8 +1,23 @@
-Section "Device"
+# DietPi X.org config
+# All credits go to Rockchip: https://github.com/rockchip-linux/rk-rootfs-build/blob/master/overlay/etc/X11/xorg.conf.d/20-modesetting.conf
+Section "Device"
Identifier "Rockchip Graphics"
Driver "modesetting"
- Option "AccelMethod" "glamor"
+ Option "AccelMethod" "exa"
+# Option "AccelMethod" "glamor"
Option "DRI" "2"
+ Option "FlipFB" "always"
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Rockchip Graphics"
+ Monitor "Default Monitor"
+EndSection
+### Valid values for rotation are "normal", "left", "right"
+Section "Monitor"
+ Identifier "Default Monitor"
+ Option "Rotate" "normal"
EndSection
diff --git a/.conf/dps_85/nginx.default b/.conf/dps_85/nginx.default
index eb57a2b192..8b95e72904 100644
--- a/.conf/dps_85/nginx.default
+++ b/.conf/dps_85/nginx.default
@@ -4,25 +4,22 @@
server {
listen 80 default_server;
+ listen [::]:80 default_server;
root /var/www;
- index index.php index.html index.htm;
+ index index.php index.html index.htm index.nginx-debian.html;
server_name "$hostname";
+ include /etc/nginx/sites-dietpi/*.conf;
+
location / {
try_files $uri $uri/ =404;
}
location ~ \.php(?:$|/) {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_param PATH_INFO $fastcgi_path_info;
+ include snippets/fastcgi-php.conf;
fastcgi_pass php;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
}
- include /etc/nginx/sites-dietpi/*.conf;
-
}
diff --git a/.conf/dps_93/apache.block_public_admin.conf b/.conf/dps_93/apache.block_public_admin.conf
new file mode 100644
index 0000000000..fbe2e8e40d
--- /dev/null
+++ b/.conf/dps_93/apache.block_public_admin.conf
@@ -0,0 +1,4 @@
+# Block public access to admin panel
+
+ Require ip 127 192.168 10 172.16.0.0/12
+
diff --git a/.conf/dps_93/apache.pihole.conf b/.conf/dps_93/apache.pihole.conf
new file mode 100644
index 0000000000..c91c176b1b
--- /dev/null
+++ b/.conf/dps_93/apache.pihole.conf
@@ -0,0 +1,20 @@
+# If the URL starts with /admin, it is the Web interface
+
+ # Create a response header for debugging using curl -I
+ Header set X-Pi-hole "The Pi-hole Web interface is working!"
+ Header set X-Frame-Options "deny"
+
+ # Block . files from being served, such as .git, .github, .gitignore
+
+ Require all denied
+
+
+
+
+# Block public access to blocking page
+
+ Require ip 127 192.168 10 172.16.0.0/12
+
+
+# Enable blocking page via 404 handler
+#ErrorDocument 404 /html/pihole/index.php
diff --git a/.conf/dps_93/lighttpd.block_public_admin.conf b/.conf/dps_93/lighttpd.block_public_admin.conf
new file mode 100644
index 0000000000..1eb50d14ff
--- /dev/null
+++ b/.conf/dps_93/lighttpd.block_public_admin.conf
@@ -0,0 +1,6 @@
+# Block non-LAN access to Pi-hole admin panel
+$HTTP["url"] =~ "^(/html)?/admin(/|$)" {
+ $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." {
+ url.access-deny = ("")
+ }
+}
diff --git a/.conf/dps_93/lighttpd.pihole.conf b/.conf/dps_93/lighttpd.pihole.conf
new file mode 100644
index 0000000000..4fe8db481a
--- /dev/null
+++ b/.conf/dps_93/lighttpd.pihole.conf
@@ -0,0 +1,32 @@
+# Based on: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian
+
+# If the URL starts with /admin, it is the Web interface
+$HTTP["url"] =~ "^(/html)?/admin/" {
+ # Create a response header for debugging using curl -I
+ setenv.add-response-header = (
+ "X-Pi-hole" => "The Pi-hole Web interface is working!",
+ "X-Frame-Options" => "DENY"
+ )
+
+ $HTTP["url"] =~ "\.ttf$" {
+ # Allow Block Page access to local fonts
+ setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
+ }
+}
+
+# Block . files from being served, such as .git, .github, .gitignore
+$HTTP["url"] =~ "^(/html)?/admin/\." {
+ url.access-deny = ("")
+}
+
+# If it's a request to Pi-hole blocking page...
+$HTTP["url"] =~ "^(/html)?/pihole/" {
+ # ... and the request isn't local
+ $HTTP["remoteip"] !~ "^1(27|92\.168|0|72\.(1[6-9]|2[0-9]|3[0-1]))\." {
+ # block!
+ url.access-deny = ("")
+ }
+}
+
+# Enable blocking page via 404 handler
+#server.error-handler-404 = "/html/pihole/index.php"
diff --git a/.conf/dps_93/nginx.block_public_admin.conf b/.conf/dps_93/nginx.block_public_admin.conf
new file mode 100644
index 0000000000..389dabae25
--- /dev/null
+++ b/.conf/dps_93/nginx.block_public_admin.conf
@@ -0,0 +1,9 @@
+# Block public access to Pi-hole admin panel
+# Location: /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.{on,off}
+# - Enable with file ending .on
+# - Disable with file ending .off
+allow 127.0.0.0/8;
+allow 192.168.0.0/16;
+allow 10.0.0.0/8;
+allow 172.16.0.0/12;
+deny all;
diff --git a/.conf/dps_93/nginx.pihole.conf b/.conf/dps_93/nginx.pihole.conf
new file mode 100644
index 0000000000..04b05b36bf
--- /dev/null
+++ b/.conf/dps_93/nginx.pihole.conf
@@ -0,0 +1,39 @@
+# Admin panel
+location ~ ^(?:/html|)/admin(?:$|/) {
+ # Block public access to admin page, if enabled
+ # - To enable: cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.off dietpi-pihole-block_public_admin.on
+ # - To disable: cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.on dietpi-pihole-block_public_admin.off
+ include sites-dietpi/dietpi-pihole-block_public_admin.*on;
+ # Block . files from being served, such as .git, .github, .gitignore
+ location ~ ^(?:/html|)/admin/\. {
+ deny all;
+ }
+ # Create a response header for debugging using curl -I
+ add_header X-Pi-hole "The Pi-hole Web interface is working!";
+ add_header X-Frame-Options "DENY";
+ # Standard PHP handler block
+ try_files $uri $uri/ =404;
+ location ~ ^(?:/html|)/admin/.+\.php(?:$|/) {
+ fastcgi_pass php;
+ include snippets/fastcgi-php.conf;
+ }
+}
+
+# Blocking page
+location ~ ^(?:/html|)/pihole(?:$|/) {
+ # Block public access to blocking page by default
+ allow 127.0.0.0/8;
+ allow 192.168.0.0/16;
+ allow 10.0.0.0/8;
+ allow 172.16.0.0/12;
+ deny all;
+ # Standard PHP handler block
+ try_files $uri $uri/ =404;
+ location ~ ^(?:/html|)/pihole/.+\.php(?:$|/) {
+ fastcgi_pass php;
+ include snippets/fastcgi-php.conf;
+ }
+}
+
+# Enable blocking page via 404 handler
+#error_page 404 /html/pihole/index.php;
diff --git a/.conf/dps_94/conf b/.conf/dps_94/conf
index 64901177af..ec3027cc7e 100644
--- a/.conf/dps_94/conf
+++ b/.conf/dps_94/conf
@@ -2,7 +2,6 @@
# File Location
# /etc/proftpd/proftpd.conf
-
# Includes DSO modules
Include /etc/proftpd/modules.conf
diff --git a/.conf/dps_98/haproxy.service b/.conf/dps_98/haproxy.service
index 18f40a56c1..5e9f8f152d 100644
--- a/.conf/dps_98/haproxy.service
+++ b/.conf/dps_98/haproxy.service
@@ -18,7 +18,6 @@ EXTRAOPTS=
. /lib/lsb/init-functions
-
haproxy_start()
{
start-stop-daemon --start --pidfile "$PIDFILE" \
@@ -64,7 +63,6 @@ haproxy_status()
return 0
}
-
case "$1" in
start)
log_daemon_msg "Starting haproxy" "haproxy"
diff --git a/.meta/dietpi-imager b/.meta/dietpi-imager
index eb85386986..317ef7aaa6 100755
--- a/.meta/dietpi-imager
+++ b/.meta/dietpi-imager
@@ -8,9 +8,9 @@
# Updated by MichaIng / micha@dietpi.com / dietpi.com
#
#////////////////////////////////////
- # - Reads disk to image | or use existing .img file
- # - Resizes RootFS partition
- # - Hashes and 7z's the final image ready for release.
+ # - Create new .img file from drive | or use existing .img file
+ # - Minimises root partition and file system
+ # - Hashes and 7z's the final image ready for release
#////////////////////////////////////
# Import DietPi-Globals ---------------------------------------------------------------
@@ -21,24 +21,19 @@
G_INIT
# Import DietPi-Globals ---------------------------------------------------------------
+ FP_SOURCE_IMG=''
FP_SOURCE=''
- FP_LOOPBACK=''
FP_ROOT_DEV=''
- ROOT_PARTITION_INDEX=''
+ ROOT_PARTITION_INDEX=0
OUTPUT_IMG_NAME=''
OUTPUT_7Z_NAME=''
GPT=0
- DIETPI_VERSION='v6.25'
- Delete_Loopback(){
-
- [[ $FP_LOOPBACK ]] && G_RUN_CMD losetup -d $FP_LOOPBACK
-
- }
+ Delete_Loopback(){ [[ -b $FP_SOURCE ]] && G_RUN_CMD losetup -d $FP_SOURCE; }
Exit_On_Fail(){
- Delete_Loopback
+ [[ $FP_SOURCE_IMG ]] && Delete_Loopback
exit 1
}
@@ -47,58 +42,91 @@
G_WHIP_MENU_ARRAY=(
- 'Drive' ': Save a drive/disk contents to an image, that you can work with'
- 'Image' ': Use an existing image file (.img) to work with'
+ 'Drive' ': The OS is stored on an attached drive.'
+ 'Image' ': The OS is stored as an image (.img) file.'
)
- G_WHIP_MENU 'Please select an option:' || Exit_On_Fail
+ G_WHIP_MENU 'Please select how the input OS is stored:
+\nNB: If you want to create a Clonezilla-based installer image, the input OS needs to be attached as physical drive, since Clonezilla currently does neither support .img files nor loop devices.' || Exit_On_Fail
if [[ $G_WHIP_RETURNED_VALUE == 'Drive' ]]; then
# Detect drives and list for selection
- G_WHIP_MENU_ARRAY=($(lsblk -npo NAME,SIZE | grep '^/'))
- if [[ ! $G_WHIP_MENU_ARRAY ]] || ! G_WHIP_MENU 'Please select the drive you wish to save as an image:'; then
+ G_WHIP_MENU_ARRAY=($(lsblk -dnpo NAME,SIZE))
+ # - Visually separate dev name and space
+ for ((i=1;i<${#G_WHIP_MENU_ARRAY[@]};i+=2)); do G_WHIP_MENU_ARRAY[$i]=": ${G_WHIP_MENU_ARRAY[$i]}"; done
+ if [[ $G_WHIP_MENU_ARRAY ]]; then
+
+ G_WHIP_MENU 'Please select the drive you wish to create the image from:' || Exit_On_Fail
+
+ else
+ G_DIETPI-NOTIFY 1 'No drives found, aborting...'
Exit_On_Fail
fi
- FP_SOURCE='/root/dietpi-imager_tmp.img'
- dd if=$G_WHIP_RETURNED_VALUE of=$FP_SOURCE bs=4K status=progress || Exit_On_Fail
+ FP_SOURCE=$G_WHIP_RETURNED_VALUE
+
+ G_DIETPI-NOTIFY 2 'Unmounting all mounted file systems of the selected source drive...'
+ for i in $FP_SOURCE*
+ do
+
+ findmnt $i &> /dev/null && { umount $i || Exit_On_Fail; }
+
+ done
elif [[ $G_WHIP_RETURNED_VALUE == 'Image' ]]; then
- /DietPi/dietpi/dietpi-explorer 1 /root
+ # Open DietPi-Explorer for image file selection
local fp_selected='/tmp/.dietpi-explorer_selected_location'
- [[ -f $fp_selected ]] || Exit_On_Fail
- FP_SOURCE=$(<$fp_selected)
+ [[ -f $fp_selected ]] && rm $fp_selected # Failsafe
+ /DietPi/dietpi/dietpi-explorer 1 /root
+ [[ -f $fp_selected && $(<$fp_selected) ]] || Exit_On_Fail
+ FP_SOURCE_IMG=$(<$fp_selected)
rm $fp_selected
- if [[ ! -f $FP_SOURCE ]]; then
+ if [[ ! -f $FP_SOURCE_IMG ]]; then
- G_DIETPI-NOTIFY 1 "Source image file ($FP_SOURCE) does not exist, aborting..."
+ G_DIETPI-NOTIFY 1 "Selected image file ($FP_SOURCE_IMG) does not exist, aborting..."
Exit_On_Fail
fi
- fi
+ # Create loopback device from .img file
+ modprobe loop || Exit_On_Fail
+ FP_SOURCE=$(losetup -f)
+ losetup $FP_SOURCE "$FP_SOURCE_IMG" || Exit_On_Fail
+ partprobe $FP_SOURCE || Exit_On_Fail
+ G_DIETPI-NOTIFY 0 "Mounted the image ($FP_SOURCE_IMG) as loopback device: $FP_SOURCE"
- # Attach .img file to loop device
- modprobe loop || Exit_On_Fail
- FP_LOOPBACK=$(losetup -f)
- losetup $FP_LOOPBACK "$FP_SOURCE" || Exit_On_Fail
- partprobe $FP_LOOPBACK || Exit_On_Fail
+ fi
# Detect partitions and list for selection
- G_WHIP_MENU_ARRAY=($(lsblk -npo NAME,SIZE ${FP_LOOPBACK}?*))
- G_WHIP_MENU "Please select the root partition of $FP_LOOPBACK" || Exit_On_Fail
- ROOT_PARTITION_INDEX=${G_WHIP_RETURNED_VALUE: -1}
+ G_WHIP_MENU_ARRAY=($(lsblk -npo NAME,SIZE ${FP_SOURCE}?*))
+ # - Visually separate dev name and space
+ for ((i=1;i<${#G_WHIP_MENU_ARRAY[@]};i+=2)); do G_WHIP_MENU_ARRAY[$i]=": ${G_WHIP_MENU_ARRAY[$i]}"; done
+ G_WHIP_MENU 'Please select the OS root partition:' || Exit_On_Fail
+ FP_ROOT_DEV=$G_WHIP_RETURNED_VALUE
+ ROOT_PARTITION_INDEX=${FP_ROOT_DEV: -1}
G_WHIP_DEFAULT_ITEM='DietPi_--'
- G_WHIP_INPUTBOX "Please enter the new/output filename for $FP_SOURCE\n - DietPi_--\n - EG: DietPi_RPi-ARMv6-Stretch" || Exit_On_Fail
+ G_WHIP_INPUTBOX 'Please enter the filename for the new image:\n - DietPi_--\n - EG: DietPi_RPi-ARMv6-Buster' || Exit_On_Fail
OUTPUT_IMG_NAME=$G_WHIP_RETURNED_VALUE
+ OUTPUT_7Z_NAME="$OUTPUT_IMG_NAME.7z"
+
+ # Add version number to output file name
+ G_WHIP_DEFAULT_ITEM='v6.25'
+ G_WHIP_INPUTBOX 'Please enter the DietPi version for this image:\n - EG: v6.25' || Exit_On_Fail
+ OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME//DietPi_/DietPi_${G_WHIP_RETURNED_VALUE}_}.img"
+
+ # Check for existing file, in case offer backup
+ if [[ -f '/root/'$OUTPUT_IMG_NAME ]]; then
+
+ G_WHIP_BUTTON_OK_TEXT='Overwrite'
+ G_WHIP_BUTTON_CANCEL_TEXT='Backup'
+ G_WHIP_YESNO "[WARNING] /root/$OUTPUT_IMG_NAME already exists\n
+Do you want to overwrite or backup the existing file to $OUTPUT_IMG_NAME.bak?" || mv /root/$OUTPUT_IMG_NAME /root/$OUTPUT_IMG_NAME.bak
- G_WHIP_DEFAULT_ITEM=$DIETPI_VERSION
- G_WHIP_INPUTBOX 'Please enter the DietPi version for this image:' || Exit_On_Fail
- DIETPI_VERSION=$G_WHIP_RETURNED_VALUE
+ fi
}
@@ -107,56 +135,51 @@
Menu_Main
# Install required packages
- G_AG_CHECK_INSTALL_PREREQ gdisk dosfstools parted zerofree p7zip
+ G_AG_CHECK_INSTALL_PREREQ parted zerofree p7zip
- # Auto detect GPT partition table, failsafe detection of MBR to debug possibly other wording/partition table types
- if [[ $(parted $FP_LOOPBACK print) == *'Partition Table: msdos'* ]]; then
+ # Auto detect partition table type, failsafe detection of MBR to debug possibly other/unknown wording/partition table types
+ if [[ $(parted -s $FP_SOURCE print) == *'Partition Table: msdos'* ]]; then
+ G_DIETPI-NOTIFY 2 'MBR partition table detected'
GPT=0
- elif [[ $(parted $FP_LOOPBACK print) == *'Partition Table: gpt'* ]]; then
+ # GPT images:
+ # - "GPT PMBR size mismatch (4458495 != 15523839)"
+ # - "Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used."
+ # - gdisk write will correct this
+ elif [[ $(parted -s $FP_SOURCE print) == *'Partition Table: gpt'* ]]; then
+ G_DIETPI-NOTIFY 2 'GPT partition table detected, applying gdisk fix...'
GPT=1
+ G_AG_CHECK_INSTALL_PREREQ gdisk
+ echo -e 'w\ny\nq\n' | gdisk $FP_SOURCE
else
- G_DIETPI-NOTIFY 1 "Unknown partition table type ($(parted $FP_LOOPBACK print | mawk '/^Partition Table:/ {print $3;exit}')), aborting..."
+ G_DIETPI-NOTIFY 1 "Unknown partition table type ($(parted -s $FP_SOURCE print | mawk '/^Partition Table:/ {print $3;exit}')), aborting..."
Exit_On_Fail
fi
- # GPT images (RockPro64) after reading the image AND again after shrinking
- # To fix:
- # - GPT PMBR size mismatch (4458495 != 15523839) will be corrected by w(rite).
- # - 15523806
- # RUN
- # - gdisk "$IMAGE_FP/$IMAGE_NAME"
- # w | y
- (( $GPT )) && echo -e 'w\ny\nq\n' | gdisk $FP_LOOPBACK # Needs testing for automation...
-
- # root partition dev
- FP_ROOT_DEV="${FP_LOOPBACK}p${ROOT_PARTITION_INDEX}"
-
- # Fsck
e2fsck -f $FP_ROOT_DEV
- # Remount image for any required edits.
- fp_mnt='loopback_rootfs'
+ # Remount image for any required edits
+ fp_mnt='tmp_rootfs'
mkdir -p /mnt/$fp_mnt
if G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD mount $FP_ROOT_DEV /mnt/$fp_mnt; then
G_WHIP_MSG "Image mounted for file editing, make changes if required: $FP_ROOT_DEV > /mnt/$fp_mnt\n\nPress 'Ok' when you are finished."
sync
G_RUN_CMD umount /mnt/$fp_mnt
- partprobe $FP_LOOPBACK # Probably not required as no partition changes, regardless, no harm.
+ partprobe $FP_SOURCE # Failsafe
fi
- # Fsck
- e2fsck -f $FP_ROOT_DEV
+ e2fsck -f $FP_ROOT_DEV # Failsafe
# Shrink file system to minimum
# - Run multiple times until no change is done any more
+ G_DIETPI-NOTIFY 2 'Shrinking RootFS to minimum size...'
local out
FS_SIZE=0
while :
@@ -183,50 +206,59 @@
done
# Estimate minimum end sector
- PART_START=$(fdisk -l -o Start $FP_LOOPBACK | tail -1) # 512 byte sectors
- PART_END=$(( $PART_START + $FS_SIZE ))
+ PART_START=$(fdisk -l -o Device,Start $FP_SOURCE | grep "^$FP_ROOT_DEV" | mawk '{print $2}') # 512 byte sectors
+ PART_END_CURRENT=$(fdisk -l -o Device,End $FP_SOURCE | grep "^$FP_ROOT_DEV" | mawk '{print $2}')
+ PART_END_TARGET=$(( $PART_START + $FS_SIZE ))
- G_DIETPI-NOTIFY 2 "Shrinking root partition to: $(( $FS_SIZE / 2048 + 1 )) MiB"
- parted $FP_LOOPBACK unit s resizepart $ROOT_PARTITION_INDEX $PART_END yes
- partprobe $FP_LOOPBACK
- sync
+ # Only try to shrink partition when new end sector is less than current end sector
+ if (( $PART_END_CURRENT > $PART_END_TARGET )); then
- # Override free space with zeros to purge removed data and allow further image/archive size reduction
+ G_DIETPI-NOTIFY 2 "Shrinking root partition to: $(( $FS_SIZE / 2048 + 1 )) MiB"
+ parted $FP_SOURCE unit s resizepart $ROOT_PARTITION_INDEX $PART_END_TARGET yes
+ partprobe $FP_SOURCE
+
+ fi
+
+ G_DIETPI-NOTIFY 2 'Overriding root partition free space with zeros to purge removed data and allow further archive size reduction...'
zerofree -v $FP_ROOT_DEV
+ sync
- # GPT images (RockPro64) after reading the image AND again after shrinking
- # To fix:
- # - GPT PMBR size mismatch (4458495 != 15523839) will be corrected by w(rite).
- # - 15523806
- # RUN
- # - gdisk "$IMAGE_FP/$IMAGE_NAME"
- # w | y
- (( $GPT )) && echo -e 'w\ny\nq\n' | gdisk $FP_LOOPBACK
+ # GPT images:
+ # - "GPT PMBR size mismatch (4458495 != 15523839)"
+ # - "Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used."
+ # - gdisk write will correct this
+ (( $GPT )) && echo -e 'w\ny\nq\n' | gdisk $FP_SOURCE
- # Estimate used size
- PART_SIZE=$(( ( $(fdisk -l -o End $FP_LOOPBACK | tail -1) + 1 ) * 512 )) # 512 byte sectors => Byte
- IMAGE_SIZE=$(( $PART_SIZE + ( 512 * 256 ) )) # 64 byte for secondary GPT + safety net
+ # Finished: Derive final image size from last partition end + failsafe buffer
+ partprobe $FP_SOURCE
+ IMAGE_SIZE=$(( ( $(fdisk -l -o End $FP_SOURCE | tail -1) + 1 ) * 512 )) # 512 byte sectors => Byte
+ IMAGE_SIZE=$(( $IMAGE_SIZE + ( 512 * 256 ) )) # 64 byte for secondary GPT + safety net
- # Create final image in /root
+ # Created final image + archive in /root
cd /root
- # Truncate image file to used size
- truncate --size=$IMAGE_SIZE "$FP_SOURCE"
+ # Image file source
+ if [[ $FP_SOURCE_IMG ]]; then
- # Loopback finished, clear loop
- partprobe $FP_LOOPBACK
- sync
- Delete_Loopback
+ # Clear loop
+ Delete_Loopback
- # Add version number to output file name
- OUTPUT_7Z_NAME="$OUTPUT_IMG_NAME.7z"
- OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME//DietPi_/DietPi_${DIETPI_VERSION}_}.img"
+ G_DIETPI-NOTIFY 2 "Truncating final image file to actually used size: $(( $IMAGE_SIZE / 1024 / 1024 + 1 )) MiB"
+ truncate --size=$IMAGE_SIZE "$FP_SOURCE_IMG"
+
+ # Rename and move to /root
+ mv "$FP_SOURCE_IMG" $OUTPUT_IMG_NAME
- # Move new img to /root
- mv $FP_SOURCE $OUTPUT_IMG_NAME # TODO: if not same already location/file...
+ # Drive source
+ else
+
+ G_DIETPI-NOTIFY 2 "Creating final image with actually used size: $(( $IMAGE_SIZE / 1024 / 1024 + 1 )) MiB"
+ dd if=$FP_SOURCE of=$OUTPUT_IMG_NAME bs=1M status=progress count=$(( $IMAGE_SIZE / 1024 / 1024 + 1 ))
+
+ fi
# Generate hashes: MD5, SHA1, SHA256
- G_DIETPI-NOTIFY 2 'Generating hash.txt, please wait...'
+ G_DIETPI-NOTIFY 2 'Generating hashes to pack with image, please wait...'
cat << _EOF_ > hash.txt
FILE: $OUTPUT_IMG_NAME
DATE: $(date)
@@ -236,15 +268,19 @@ SHA256: $(sha256sum $OUTPUT_IMG_NAME | mawk '{print $1}')
_EOF_
# Download current README
+ G_DIETPI-NOTIFY 2 'Downloading current README.md to pack with image...'
wget https://raw.githubusercontent.com/MichaIng/DietPi/master/README.md -O README.md || Exit_On_Fail
# Generate 7z archive
# NB: LZMA2 ultra compression method requires 2G RAM
[[ -f $OUTPUT_7Z_NAME ]] && rm $OUTPUT_7Z_NAME
+ G_DIETPI-NOTIFY 2 'Creating final 7zip archive...'
if 7zr a -m0=lzma2 -mx=9 $OUTPUT_7Z_NAME $OUTPUT_IMG_NAME hash.txt README.md; then
rm hash.txt README.md
- G_WHIP_MSG "[INFO] /root/$OUTPUT_7Z_NAME created"
+ G_WHIP_MSG "[ OK ] DietPi-Imager has successfully finished.\n
+Final image file: /root/$OUTPUT_IMG_NAME
+Final 7z archive: /root/$OUTPUT_7Z_NAME"
fi
diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report
index f803d6104e..766fa21846 100644
--- a/.meta/dietpi-survey_report
+++ b/.meta/dietpi-survey_report
@@ -6,8 +6,8 @@
#-----------------------------------------------------------
# Globals - benchmarks
#-----------------------------------------------------------
- # NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results,
- # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc)
+ # NB: PLEASE ENSURE HW_MODEL INDEX ENTRIES MATCH : PREP, dietpi-obtain_hw_model, dietpi-survey_results,
+ # NBB: DO NOT REORDER INDEX's. These are now fixed and will never change (due to survey results etc)
aHW_NAME=()
aHW_NAME[0]='Raspberry Pi 1 256M'
aHW_NAME[1]='Raspberry Pi 1/Zero 512M'
@@ -56,15 +56,15 @@
aHW_NAME[71]='Beagle Bone Black'
aHW_NAME[72]='ROCK Pi 4'
- # - Core Benchmarks
+ # Core Benchmarks
aBENCH_CPU_INDEX=()
aBENCH_RAM_INDEX=()
aBENCH_ROOTFS_INDEX=()
- # - Optional benchmarks
+ # Optional benchmarks
aBENCH_LAN_INDEX=()
aBENCH_CUSTOMFS_INDEX=()
- #[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}]
+ # [$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}]
declare -A aBENCH_CPU
declare -A aBENCH_ROOTFS_WRITE
declare -A aBENCH_ROOTFS_READ
@@ -73,12 +73,12 @@
declare -A aBENCH_CPU_TEMP_START
declare -A aBENCH_CPU_TEMP_END
- # - Optional benchmarks
+ # Optional benchmarks
declare -A aBENCH_CUSTOMFS_WRITE
declare -A aBENCH_CUSTOMFS_READ
declare -A aBENCH_NET_LAN_SPEED
- #Results
+ # Results
BENCH_RESULTS_CPU_SCALE=1
aBENCH_RESULT_CPU_MIN=()
aBENCH_RESULT_CPU_MAX=()
@@ -133,7 +133,6 @@
declare -A aDISTRO_VERSION
declare -A aAUTOSTART_OPTION
declare -A aSOFTWARE
- # v6.10 additions
aAUTO_SETUP_AUTOMATED=(
[0]=0
[1]=0
@@ -310,7 +309,7 @@
aSOFTWARE_NAME[145]='Radarr'
aSOFTWARE_NAME[146]='Tautulli'
aSOFTWARE_NAME[147]='Jackett'
- aSOFTWARE_NAME[148]='148'
+ aSOFTWARE_NAME[148]=148
aSOFTWARE_NAME[149]='NZBget'
aSOFTWARE_NAME[150]='Mono'
aSOFTWARE_NAME[151]='Nvidia'
@@ -330,29 +329,23 @@
aSOFTWARE_NAME[165]='Gitea'
aSOFTWARE_NAME[166]='PI-SPC'
aSOFTWARE_NAME[167]='Raspotify'
- aSOFTWARE_NAME[168]='168'
+ aSOFTWARE_NAME[168]=168
aSOFTWARE_NAME[169]='Google AIY'
- # - v6.14 (earliest version that can upload to ssh.dietpi.com)
+ # v6.14 (earliest version that uploads to ssh.dietpi.com)
aSOFTWARE_NAME6_14=()
+ # v6.15
+ aSOFTWARE_NAME6_15=()
for i in ${!aSOFTWARE_NAME[@]}
do
aSOFTWARE_NAME6_14[$i]=${aSOFTWARE_NAME[$i]}
-
- done
-
- # - v6.15
- aSOFTWARE_NAME6_15=()
- for i in ${!aSOFTWARE_NAME6_14[@]}
- do
-
aSOFTWARE_NAME6_15[$i]=${aSOFTWARE_NAME6_14[$i]}
done
aSOFTWARE_NAME6_15[148]='myMPD'
- # - v6.16 + v6.17 + v6.18
+ # v6.16 + v6.17 + v6.18
aSOFTWARE_NAME6_16=()
aSOFTWARE_NAME6_17=()
aSOFTWARE_NAME6_18=()
@@ -366,7 +359,7 @@
done
aSOFTWARE_NAME6_18[168]='Nextcloud Talk'
- # - v6.19 + v6.20
+ # v6.19 + v6.20
aSOFTWARE_NAME6_19=()
aSOFTWARE_NAME6_20=()
for i in ${!aSOFTWARE_NAME6_18[@]}
@@ -381,7 +374,7 @@
aSOFTWARE_NAME6_20[171]='DietPi-NordVPN'
aSOFTWARE_NAME6_20[172]='WireGuard'
- # - v6.21 + v6.22 + v6.23
+ # v6.21 + v6.22 + v6.23
aSOFTWARE_NAME6_21=()
aSOFTWARE_NAME6_22=()
aSOFTWARE_NAME6_23=()
@@ -397,7 +390,7 @@
aSOFTWARE_NAME6_23[174]='GIMP'
aSOFTWARE_NAME6_23[175]='XFCE Power Manager'
- # - v6.24 + v6.25
+ # v6.24 + v6.25
aSOFTWARE_NAME6_24=()
aSOFTWARE_NAME6_25=()
for i in ${!aSOFTWARE_NAME6_23[@]}
@@ -409,7 +402,7 @@
done
aSOFTWARE_NAME6_25[176]='Mycroft AI'
- # - v6.26
+ # v6.26
aSOFTWARE_NAME6_26=()
for i in ${!aSOFTWARE_NAME6_25[@]}
do
@@ -417,6 +410,7 @@
aSOFTWARE_NAME6_26[$i]=${aSOFTWARE_NAME6_25[$i]}
done
+ aSOFTWARE_NAME6_26[27]=27
Main(){
@@ -440,90 +434,84 @@
fi
# Source survey files
- if grep -q '^#!/bin/bash' $file; then
+ if [[ $(<$file) == '#!/bin/bash'* ]]; then
. $file
- # - Add bench to array
- if [[ $BENCH_VERSION ]]; then
-
- if [[ $G_DEBUG == 1 ]]; then
-
- echo "DEBUG $file: BENCH_VERSION=$BENCH_VERSION | BENCH_HW_MODEL=$BENCH_HW_MODEL BENCH_CPU=$BENCH_CPU | BENCH_ROOTFS_WRITE=$BENCH_ROOTFS_WRITE | BENCH_ROOTFS_READ=$BENCH_ROOTFS_READ | BENCH_RAM_WRITE=$BENCH_RAM_WRITE | BENCH_RAM_READ=$BENCH_RAM_READ | BENCH_CPU_TEMP_START=$BENCH_CPU_TEMP_START | BENCH_CPU_TEMP_END=$BENCH_CPU_TEMP_END | BENCH_CUSTOMFS_WRITE=$BENCH_CUSTOMFS_WRITE | BENCH_CUSTOMFS_READ=$BENCH_CUSTOMFS_READ | BENCH_NET_LAN_SPEED=$BENCH_NET_LAN_SPEED"
+ # Add bench to array
+ if [[ $BENCH_HW_MODEL =~ ^[0-9]+$ ]]; then
- fi
-
- # - CPU
- if [[ ${BENCH_CPU//.*} =~ ^-?[0-9]+$ &&
- $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then
+ # CPU
+ # - Remove decimal places
+ BENCH_CPU_TEMP_START=${BENCH_CPU_TEMP_START%%.*}
+ BENCH_CPU_TEMP_END=${BENCH_CPU_TEMP_END%%.*}
+ if [[ ${BENCH_CPU%%.*} =~ ^[0-9]+$ && $BENCH_CPU_TEMP_START =~ ^-?[0-9]+$ && $BENCH_CPU_TEMP_END =~ ^-?[0-9]+$ ]]; then
aBENCH_CPU[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CPU
- # - Patch for 5 digit CPU temp's: https://github.com/MichaIng/DietPi/issues/2715
- (( ${BENCH_CPU_TEMP_START//.*} > 130 )) && (( BENCH_CPU_TEMP_START /= 1000 ))
- (( ${BENCH_CPU_TEMP_END//.*} > 130 )) && (( BENCH_CPU_TEMP_END /= 1000 ))
- # ------------------------------------------------------------------------------
-
- aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_START//.*}
- aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=${BENCH_CPU_TEMP_END//.*}
+ # - Patch for 5 digit CPU temps: https://github.com/MichaIng/DietPi/issues/2715
+ (( $BENCH_CPU_TEMP_START > 130 )) && (( BENCH_CPU_TEMP_START /= 1000 ))
+ (( $BENCH_CPU_TEMP_END > 130 )) && (( BENCH_CPU_TEMP_END /= 1000 ))
+ aBENCH_CPU_TEMP_START[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_START
+ aBENCH_CPU_TEMP_END[$BENCH_HW_MODEL,${aBENCH_CPU_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CPU_TEMP_END
((aBENCH_CPU_INDEX[$BENCH_HW_MODEL]++))
fi
- # - RootFS
- if [[ ${BENCH_ROOTFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_ROOTFS_READ//.*} =~ ^-?[0-9]+$ ]]; then
-
- aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_ROOTFS_WRITE//.*}
- aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=${BENCH_ROOTFS_READ//.*}
+ # RootFS
+ # - Remove decimal places
+ BENCH_ROOTFS_WRITE=${BENCH_ROOTFS_WRITE%%.*}
+ BENCH_ROOTFS_READ=${BENCH_ROOTFS_READ%%.*}
+ if [[ $BENCH_ROOTFS_WRITE =~ ^[0-9]+$ && $BENCH_ROOTFS_READ =~ ^[0-9]+$ ]]; then
+ aBENCH_ROOTFS_WRITE[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_ROOTFS_WRITE
+ aBENCH_ROOTFS_READ[$BENCH_HW_MODEL,${aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_ROOTFS_READ
((aBENCH_ROOTFS_INDEX[$BENCH_HW_MODEL]++))
fi
- # - RAM
+ # RAM
# - https://github.com/MichaIng/DietPi/issues/2715 | nullify this score and ignore it in min/max/avg processing.
- if (( $BENCH_VERSION >= 2 )) &&
- [[ ${BENCH_RAM_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_RAM_READ//.*} =~ ^-?[0-9]+$ ]]; then
-
- aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_RAM_WRITE//.*}
- aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=${BENCH_RAM_READ//.*}
+ # - Remove decimal places
+ BENCH_RAM_WRITE=${BENCH_RAM_WRITE%%.*}
+ BENCH_RAM_READ=${BENCH_RAM_READ%%.*}
+ if [[ $BENCH_VERSION =~ ^[0-9]+$ && $BENCH_RAM_WRITE =~ ^[0-9]+$ && $BENCH_RAM_READ =~ ^[0-9]+$ ]] && (( $BENCH_VERSION > 1 )); then
+ aBENCH_RAM_WRITE[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_RAM_WRITE
+ aBENCH_RAM_READ[$BENCH_HW_MODEL,${aBENCH_RAM_INDEX[$BENCH_HW_MODEL]}]=$BENCH_RAM_READ
((aBENCH_RAM_INDEX[$BENCH_HW_MODEL]++))
fi
- # - Custom FS
- if [[ ${BENCH_CUSTOMFS_WRITE//.*} =~ ^-?[0-9]+$ && ${BENCH_CUSTOMFS_READ//.*} =~ ^-?[0-9]+$ ]]; then
-
- aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_CUSTOMFS_WRITE//.*}
- aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_CUSTOMFS_READ//.*}
+ # Custom FS
+ # - Remove decimal places
+ BENCH_CUSTOMFS_WRITE=${BENCH_CUSTOMFS_WRITE%%.*}
+ BENCH_CUSTOMFS_READ=${BENCH_CUSTOMFS_READ%%.*}
+ if [[ $BENCH_CUSTOMFS_WRITE =~ ^[0-9]+$ && $BENCH_CUSTOMFS_READ =~ ^[0-9]+$ ]]; then
+ aBENCH_CUSTOMFS_WRITE[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_CUSTOMFS_WRITE
+ aBENCH_CUSTOMFS_READ[$BENCH_HW_MODEL,${aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]}]=$BENCH_CUSTOMFS_READ
((aBENCH_CUSTOMFS_INDEX[$BENCH_HW_MODEL]++))
fi
- # - LAN
- if [[ ${BENCH_NET_LAN_SPEED//.*} =~ ^-?[0-9]+$ ]]; then
-
- aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=${BENCH_NET_LAN_SPEED//.*}
+ # LAN
+ # - Remove decimal places
+ BENCH_NET_LAN_SPEED=${BENCH_NET_LAN_SPEED%%.*}
+ if [[ $BENCH_NET_LAN_SPEED =~ ^[0-9]+$ ]]; then
+ aBENCH_NET_LAN_SPEED[$BENCH_HW_MODEL,${aBENCH_LAN_INDEX[$BENCH_HW_MODEL]:=0}]=$BENCH_NET_LAN_SPEED
((aBENCH_LAN_INDEX[$BENCH_HW_MODEL]++))
fi
- #Done, clear vars
- unset BENCH_VERSION
- unset BENCH_HW_MODEL
- unset BENCH_CPU
- unset BENCH_ROOTFS_WRITE
- unset BENCH_ROOTFS_READ
- unset BENCH_RAM_WRITE
- unset BENCH_RAM_READ
- unset BENCH_CPU_TEMP_START
- unset BENCH_CPU_TEMP_END
- unset BENCH_CUSTOMFS_WRITE
- unset BENCH_CUSTOMFS_READ
+ # Done, clear vars
+ unset BENCH_VERSION BENCH_HW_MODEL
+ unset BENCH_CPU BENCH_CPU_TEMP_START BENCH_CPU_TEMP_END
+ unset BENCH_ROOTFS_WRITE BENCH_ROOTFS_READ
+ unset BENCH_RAM_WRITE BENCH_RAM_READ
+ unset BENCH_CUSTOMFS_WRITE BENCH_CUSTOMFS_READ
unset BENCH_NET_LAN_SPEED
fi
@@ -538,22 +526,20 @@
# Clean up reports dir
rm -R /tmp/dietpi-survey_report
- #Process all results, for later use in HTML printout
+ # Process all results, for later use in HTML printout
# - NB: HW_MODEL array based
local default_min_value=100000
- # - CPU
+ # CPU
for i in ${!aBENCH_CPU_INDEX[@]}
do
aBENCH_RESULT_CPU_MIN[$i]=$default_min_value
aBENCH_RESULT_CPU_MAX[$i]=0
aBENCH_RESULT_CPU_AVG[$i]=0
-
aBENCH_RESULT_CPU_TEMP_START_MIN[$i]=$default_min_value
aBENCH_RESULT_CPU_TEMP_START_MAX[$i]=0
aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=0
-
aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=$default_min_value
aBENCH_RESULT_CPU_TEMP_END_MAX[$i]=0
aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=0
@@ -561,18 +547,18 @@
for (( j=0; j<${aBENCH_CPU_INDEX[$i]}; j++ ))
do
- # echo "aBENCH_CPU[$i,$j] ${aBENCH_CPU[$i,$j]}"
+ # Use bc to allow floats
if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} < ${aBENCH_RESULT_CPU_MIN[$i]}") )); then
- aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} / 1")
+ aBENCH_RESULT_CPU_MIN[$i]=${aBENCH_CPU[$i,$j]}
fi
if (( $(bc -l <<< "${aBENCH_CPU[$i,$j]} > ${aBENCH_RESULT_CPU_MAX[$i]}") )); then
- aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_CPU[$i,$j]} / 1")
+ aBENCH_RESULT_CPU_MAX[$i]=${aBENCH_CPU[$i,$j]}
fi
- aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_CPU[$i,$j]} + ${aBENCH_RESULT_CPU_AVG[$i]}")
+ aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "${aBENCH_RESULT_CPU_AVG[$i]} + ${aBENCH_CPU[$i,$j]}")
if (( ${aBENCH_CPU_TEMP_START[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_START_MIN[$i]} )); then
@@ -586,7 +572,6 @@
fi
(( aBENCH_RESULT_CPU_TEMP_START_AVG[$i] += ${aBENCH_CPU_TEMP_START[$i,$j]} ))
- # echo "aBENCH_CPU_TEMP_END[$i,$j] ${aBENCH_CPU_TEMP_END[$i,$j]}"
if (( ${aBENCH_CPU_TEMP_END[$i,$j]} < ${aBENCH_RESULT_CPU_TEMP_END_MIN[$i]} )); then
aBENCH_RESULT_CPU_TEMP_END_MIN[$i]=${aBENCH_CPU_TEMP_END[$i,$j]}
@@ -599,28 +584,22 @@
fi
(( aBENCH_RESULT_CPU_TEMP_END_AVG[$i] += ${aBENCH_CPU_TEMP_END[$i,$j]} ))
- #Last item in current array. Work out averages
+ # Last item in current array. Scale and work out averages
if (( $j == ${aBENCH_CPU_INDEX[$i]} - 1 )); then
+ aBENCH_RESULT_CPU_MIN[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MIN[$i]} / 1")
+ aBENCH_RESULT_CPU_MAX[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_MAX[$i]} / 1")
aBENCH_RESULT_CPU_AVG[$i]=$(bc -l <<< "scale=$BENCH_RESULTS_CPU_SCALE; ${aBENCH_RESULT_CPU_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]}")
aBENCH_RESULT_CPU_TEMP_START_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} ))
aBENCH_RESULT_CPU_TEMP_END_AVG[$i]=$(( ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]} / ${aBENCH_CPU_INDEX[$i]} ))
- if [[ $G_DEBUG == 1 ]]; then
-
- echo "aBENCH_RESULT_CPU_AVG $i = ${aBENCH_RESULT_CPU_AVG[$i]}"
- echo "aBENCH_RESULT_CPU_TEMP_START_AVG $i = ${aBENCH_RESULT_CPU_TEMP_START_AVG[$i]}"
- echo "aBENCH_RESULT_CPU_TEMP_END_AVG $i = ${aBENCH_RESULT_CPU_TEMP_END_AVG[$i]}"
-
- fi
-
fi
done
done
- # - RootFS
+ # RootFS
for i in ${!aBENCH_ROOTFS_INDEX[@]}
do
@@ -646,7 +625,6 @@
fi
(( aBENCH_RESULT_ROOTFS_WRITE_AVG[$i] += ${aBENCH_ROOTFS_WRITE[$i,$j]} ))
- # echo "aBENCH_ROOTFS_READ[$i,$j] ${aBENCH_ROOTFS_READ[$i,$j]}"
if (( ${aBENCH_ROOTFS_READ[$i,$j]} < ${aBENCH_RESULT_ROOTFS_READ_MIN[$i]} )); then
aBENCH_RESULT_ROOTFS_READ_MIN[$i]=${aBENCH_ROOTFS_READ[$i,$j]}
@@ -659,33 +637,25 @@
fi
(( aBENCH_RESULT_ROOTFS_READ_AVG[$i] += ${aBENCH_ROOTFS_READ[$i,$j]} ))
- #Last item in current array. Work out averages
+ # Last item in current array. Work out averages
if (( $j == ${aBENCH_ROOTFS_INDEX[$i]} - 1 )); then
aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} ))
aBENCH_RESULT_ROOTFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]} / ${aBENCH_ROOTFS_INDEX[$i]} ))
- if [[ $G_DEBUG == 1 ]]; then
-
- echo "aBENCH_RESULT_ROOTFS_WRITE_AVG $i = ${aBENCH_RESULT_ROOTFS_WRITE_AVG[$i]}"
- echo "aBENCH_RESULT_ROOTFS_READ_AVG $i = ${aBENCH_RESULT_ROOTFS_READ_AVG[$i]}"
-
- fi
-
fi
done
done
- # - RAM
+ # RAM
for i in ${!aBENCH_RAM_INDEX[@]}
do
aBENCH_RESULT_RAM_WRITE_MIN[$i]=$default_min_value
aBENCH_RESULT_RAM_WRITE_MAX[$i]=0
aBENCH_RESULT_RAM_WRITE_AVG[$i]=0
-
aBENCH_RESULT_RAM_READ_MIN[$i]=$default_min_value
aBENCH_RESULT_RAM_READ_MAX[$i]=0
aBENCH_RESULT_RAM_READ_AVG[$i]=0
@@ -705,7 +675,6 @@
fi
(( aBENCH_RESULT_RAM_WRITE_AVG[$i] += ${aBENCH_RAM_WRITE[$i,$j]} ))
- # echo "aBENCH_RAM_READ[$i,$j] ${aBENCH_RAM_READ[$i,$j]}"
if (( ${aBENCH_RAM_READ[$i,$j]} < ${aBENCH_RESULT_RAM_READ_MIN[$i]} )); then
aBENCH_RESULT_RAM_READ_MIN[$i]=${aBENCH_RAM_READ[$i,$j]}
@@ -718,26 +687,19 @@
fi
(( aBENCH_RESULT_RAM_READ_AVG[$i] += ${aBENCH_RAM_READ[$i,$j]} ))
- #Last item in current array. Work out averages
+ # Last item in current array. Work out averages
if (( $j == ${aBENCH_RAM_INDEX[$i]} - 1 )); then
aBENCH_RESULT_RAM_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_RAM_WRITE_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} ))
aBENCH_RESULT_RAM_READ_AVG[$i]=$(( ${aBENCH_RESULT_RAM_READ_AVG[$i]} / ${aBENCH_RAM_INDEX[$i]} ))
- if [[ $G_DEBUG == 1 ]]; then
-
- echo "aBENCH_RESULT_RAM_WRITE_AVG $i = ${aBENCH_RESULT_RAM_WRITE_AVG[$i]}"
- echo "aBENCH_RESULT_RAM_READ_AVG $i = ${aBENCH_RESULT_RAM_READ_AVG[$i]}"
-
- fi
-
fi
done
done
- # - LAN
+ # LAN
for i in ${!aBENCH_LAN_INDEX[@]}
do
@@ -748,8 +710,6 @@
for (( j=0; j<${aBENCH_LAN_INDEX[$i]}; j++ ))
do
- #LAN
- # echo "aBENCH_NET_LAN_SPEED[$i,$j] ${aBENCH_NET_LAN_SPEED[$i,$j]}"
if (( ${aBENCH_NET_LAN_SPEED[$i,$j]} < ${aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]} )); then
aBENCH_RESULT_NET_LAN_SPEED_MIN[$i]=${aBENCH_NET_LAN_SPEED[$i,$j]}
@@ -762,7 +722,7 @@
fi
(( aBENCH_RESULT_NET_LAN_SPEED_AVG[$i] += ${aBENCH_NET_LAN_SPEED[$i,$j]} ))
- #Last item in current array. Work out averages
+ # Last item in current array. Work out averages
if (( $j == ${aBENCH_LAN_INDEX[$i]} - 1 )); then
aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]=$(( ${aBENCH_RESULT_NET_LAN_SPEED_AVG[$i]} / ${aBENCH_LAN_INDEX[$i]} ))
@@ -773,7 +733,7 @@
done
- # - CustomFS
+ # CustomFS
for i in ${!aBENCH_CUSTOMFS_INDEX[@]}
do
@@ -799,7 +759,6 @@
fi
(( aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i] += ${aBENCH_CUSTOMFS_WRITE[$i,$j]} ))
- # echo "aBENCH_CUSTOMFS_READ[$i,$j] ${aBENCH_CUSTOMFS_READ[$i,$j]}"
if (( ${aBENCH_CUSTOMFS_READ[$i,$j]} < ${aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]} )); then
aBENCH_RESULT_CUSTOMFS_READ_MIN[$i]=${aBENCH_CUSTOMFS_READ[$i,$j]}
@@ -812,19 +771,12 @@
fi
(( aBENCH_RESULT_CUSTOMFS_READ_AVG[$i] += ${aBENCH_CUSTOMFS_READ[$i,$j]} ))
- #Last item in current array. Work out averages
+ # Last item in current array. Work out averages
if (( $j == ${aBENCH_CUSTOMFS_INDEX[$i]} - 1 )); then
aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} ))
aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]=$(( ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]} / ${aBENCH_CUSTOMFS_INDEX[$i]} ))
- if [[ $G_DEBUG == 1 ]]; then
-
- echo "aBENCH_RESULT_CUSTOMFS_WRITE_AVG $i = ${aBENCH_RESULT_CUSTOMFS_WRITE_AVG[$i]}"
- echo "aBENCH_RESULT_CUSTOMFS_READ_AVG $i = ${aBENCH_RESULT_CUSTOMFS_READ_AVG[$i]}"
-
- fi
-
fi
done
diff --git a/.meta/images/dietpi-background.png b/.meta/images/dietpi-background.png
new file mode 100644
index 0000000000..51e3f60791
Binary files /dev/null and b/.meta/images/dietpi-background.png differ
diff --git a/.meta/images/select_bkg_c.png b/.meta/images/select_bkg_c.png
new file mode 100644
index 0000000000..fb5418eda8
Binary files /dev/null and b/.meta/images/select_bkg_c.png differ
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6e4e50bc55..6fbbdb6d36 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,88 @@
+v6.26
+(15/10/19)
+
+Changes / Improvements / Optimisations:
+- General | Support for Debian Jessie has now been fully dropped from DietPi code. Jessie systems are moved to the "jessie-support" Git branch and will stay on v6.25. Critical bugs, if reported, may still be fixed, but DietPi-Software related issues and new features will not be handled anymore by the DietPi code team. However, everyone is free to open pull requests against the jessie-support branch: https://github.com/MichaIng/DietPi/tree/jessie-support
+- General | Initial support and definitions for Debian Bullseye, the new Debian testing version, have been added to DietPi code. You can now create Bullseye systems via DietPi-PREP: https://github.com/MichaIng/DietPi/issues/3009
+- General | DietPi scripts, i.e. dietpi-software, will not overwrite you custom permissions in /mnt/dietpi_userdata anymore. Instead required permissions are now only applied for individual software titles that are being installed. Besides saving you time to re-apply custom permission, this as well enhances security in some cases where software installers/archives apply/contain stricter per-file/dir permissions. Many thanks to @JJGO and @johnvick for suggesting this enhancement: https://github.com/MichaIng/DietPi/issues/2641
+- General | On first boot, when DietPi-Software finishes the initial setup, it is now assured that all APT packages, including firmware, are upgraded by performing an "apt-get dist-upgrade"/"apt full-upgrade". Since it includes upgrades regardless of underlying dependency and conflict changes, which in rare cases can perform unwanted removals, we do not do this on regualar DietPi-Update/Software runs. But on first boot, without additional packages installed yet, it is safe. Many thanks to @cmessin1 for doing this request: https://github.com/MichaIng/DietPi/issues/3098
+- Rochchip | Experimental GPU acceleration support for RK3399 SoCs and ASUS Tinker Board has been re-enabled.
+- RPi | The haveged daemon has been replaced with rng-tools, an alternative which does not work on all devices, but has been proven to work on RPi, is default on Raspbian and uses less RAM on idle.
+- RPi4 | The default CPU temperature limit (temp_limit) has been raised from 65°C to 75°C, since this device runs significantly hotter then previous RPi model. Many thanks to @trueaspects and @Trunkzeh for doing this suggestion: https://github.com/MichaIng/DietPi/issues/3019, https://github.com/MichaIng/DietPi/issues/3151
+- DietPi-Globals | The environment variable $G_USER_INPUTS has been renamed to $G_INTERACTIVE, which describes better what it does. When setting this to "0", DietPi scripts will run non-interactively, i.e. all whiptail dialog prompts and other tasks that require manual user input are skipped. Note that this is not required when running scripts from cron jobs or systemd units, since those have no STDIN attached which makes DietPi scripts run non-interactively automatically. Scripts will stay backwards-compatible, thus respect $G_USER_INPUTS for a while, but please adjust your scripts or docs where you make use of it. Many thanks to @AtkLordOverAll for contributing this change: https://github.com/MichaIng/DietPi/pull/3041
+- DietPi-PostBoot | /var/log/boottime is not created anymore. Please use "systemd-analyze" to get much more accurate and detailed boot information.
+- DietPi-PostBoot | The pre-login banner has been slightly adjusted: Default login credentials are now only shown on first boot, since the information is obsolete when user changed the password. As well an info has been added that one needs to hit to show the username input field.
+- DietPi-Banner/NordVPN: DietPi-NordVPN has a new input command to print the current VPN connection state: "dietpi-nordvpn status". This has been implemented as well into DietPi-Banner to optionally show NordVPN connection state on login automatically. Many thanks to @svh1985 for implementing this feature: https://github.com/MichaIng/DietPi/pull/3084
+- DietPi-NordVPN | Added options for connection up/down scripts, e.g. to implement killswitches, answer inbound connections from outside local network correctly, safe and track connection uptime, and similar tasks. Many thanks to @svh1985 for implementing this feature: https://github.com/MichaIng/DietPi/pull/3047
+- DietPi-Config | Audio Options: Menu has been reworked. Audio capabilities (ALSA) can be enabled and disabled as a separate option. If enabled, generic sound card auto-detection has been added to the bottom of the list for all devices. This allows the selection of generic sound devices on all SBCs, e.g. if unknown to DietPi or if our hard-coded card/device IDs are wrong due to additional attached audio hardware.
+- DietPi-Config | Some /etc/modprobe.d/ configs are merged to less files and mostly prefixed with "dietpi-", to allow easier differentiation between Debian/pre-image and DietPi files.
+- DietPi-Config | RPi: Update certain config.txt settings to match new firmware version. WiFi and Bluetooth is now disabled via related dtoverlays, which should further reduce hardware and firmware loads.
+- DietPi-Config | Added overclocking profiles for RPi4. Many thanks to @aftensleuk for request and valuable suggestions: https://dietpi.com/phpbb/viewtopic.php?f=12&t=6225
+- DietPi-Config | RPi: Re-added previously removed options to adjust initial turbo for CPU frequency on boot and to lower the idle CPU frequency. The related firmware issues have been fixed with a recent update: https://github.com/MichaIng/DietPi/issues/3147
+- DietPi-Config | RPi: Removed the option to adjust CPU frequency limits. On RPi the dynamic CPU governors only jump between "arm_freq" and "arm_freq_min", hence those limits should be set via overclocking profile and the newly re-added "ARM Idle Frequency" option.
+- DietPi-Config | RPi1/Zero: OpenGL modes/drivers can now be successfully selected/installed from display resolution menu.
+- DietPi-Software | TightVPN: Since Stretch, TightVPN has been replaced by TigerVPN, thus the install option has now been removed from code.
+- DietPi-Software | SDL2: Since we ship a tailored build for Amiberry, the general install option for SDL2 has been removed, instead it will be installed/updated along with Amiberry. If you require SDL2 for any other purpose, please install the "libsdl2-2.0.0" package from APT repository: https://packages.debian.org/libsdl2
+- DietPi-Software | Pi-hole: Logging to /var/log/pihole.log is now disabled by default, since it is not required in usual cases. Query logs, shown in web UI, are stored in database. This might also resolve possible pihole-FTL crashes in combination with DietPi-RAMlog and DietPi-Logclear. Many thanks to @kuerious for reporting and @Mcat12 for providing helpful information on this topic: https://github.com/pi-hole/FTL/issues/614
+- DietPi-Software | Pi-hole: Webserver configs have been added to block public access to the blocking page, optionally as well to the admin panel and generally block access to dot files/dirs (.git*) inside the admin panel directory. Parts are inspired by the official Lighttpd config, provided by Pi-hole: https://github.com/pi-hole/pi-hole/blob/master/advanced/lighttpd.conf.debian
+ Many thanks to @AtkLordOverAll for his effort to implement this for Lighttpd initially + the choice during install to block public admin panel access as well: https://github.com/MichaIng/DietPi/pull/3054
+- DietPi-Software | OpenVPN: Rsyslog is not installed anymore together with OpenVPN server. Logs are available via "journalctl -u openvpn", all system logs via "journalctl". If you require persistent logs, uninstall DietPi-RAMlog via dietpi-software and make the journal boot persistent via: mkdir /var/log/journal
+- DietPi-Software | Gogs: On ARMv7 and x86_64 now the latest version from GitHub is installed. Reinstalls will upgrade the version while preserving existing settings. Many thanks to @LazyLama for doing this suggestion: https://github.com/MichaIng/DietPi/issues/2999
+- DietPi-Software | Webmin: Install is now done via official APT repository to allow easier updates. To apply this to all systems, it is reinstalled on DietPi-Update to v6.26. Additionally the dependency on rsyslog has been removed. The Webmin logging panel still depends on rsyslog, but the overhead shall not be applied to all systems by default. Instead users can now decide themselves, whether they need to see system logs on Webmin, or not, and in case apply custom logging settings as well.
+- DietPi-Software | Amiberry: Enabled support for RPi4 and Odroid XU4. Thanks to @midwan for providing the binaries: https://github.com/MichaIng/DietPi/issues/3104
+- DietPi-Software | myMPD: Updated install steps to avoid deprecations of the current upstream version. As well the service will not run as primary group "dietpi" anymore, which is only required for software that creates media files. Many thanks to @jcorporation (developer of myMPD) for providing this information as well as a smooth build script that updates old instances gracefully: https://github.com/MichaIng/DietPi/issues/3097
+- DietPi-Software | WiFi Hotspot: Since on some systems, a hostapd service mask was found, it is now unmasked on install. As well our custom compiled binaries are now only installed on RTL8188C* devices where no special Realtek hostapd package is available. Many thanks to @symbios24 for reporting the service mask issue: https://github.com/MichaIng/DietPi/issues/2962
+- DietPi-Software | Fail2Ban is not handled by DietPi-Services anymore, since the brute-force protection shall stay active during updates, installs, backups etc. The service is now started by systemd on boot and stays active until shutdown. Additionally on fresh installs the default jail.conf is optimised for the set "route" ban action: "blackhole" is now the route type, which does not send any respond to blocked requests.
+- DietPi-Software | WireGuard: Support for RPi1 + RPi Zero (ARMv6 models) has been enabled by switching to Bullseye as source repo, which is available for Raspbian as well. Additionally on RPi, the WireGuard kernel module is now rebuilt automatically after kernel package upgrades. Many thanks to @johnnyt83 for suggestion RPi1/Zero support and his efforts to test the source build: https://github.com/MichaIng/DietPi/issues/2997
+- DietPi-Software | Gitea: Version 1.9.4 will be shipped from now on. Many thanks to @msongz and @minhphuc429 for implementing this update: https://github.com/MichaIng/DietPi/pull/3138, https://github.com/MichaIng/DietPi/pull/3154
+- DietPi-Software | Aria2: Runs now as it's own user "aria2" and group "dietpi" with home dir and config file moved to /mnt/dietpi_userdata/aria2/. Besides satisfying security standards, this allows other download and media related software, provided by dietpi-software, direct access to Aria2 downloads without the need for custom permission changes. Additionally the current session (download states) are saved on service stop and every 60 seconds, to prevent current tasks from being lost on reboot or power loss. Aria2 will be reinstalled with v6.26 to apply these changes. Many thanks to @msongz for implementing and testing the session feature: https://github.com/MichaIng/DietPi/pull/3139
+
+Bug Fixes:
+- General | Removed an obsolete OpenMediaVault cron job and binary that was leftover on at least one of our images (NanoPi NEO2) and is not part of the current OMV packages, thus save to remove in every case. Many thanks to @kt1024 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2994
+- General | Resolved an issue where install of required APT packages for certain scripts could fail in the rare case that APT lists are outdated and old packages are not available in the repo anymore. Many thanks to @Paulisper for reporting this issue: https://github.com/MichaIng/DietPi/issues/2996
+- General | Resolved an issue on some Buster systems where console-setup fails on boot to apply keyboard layout and console settings. Many thanks to @jaxjexjox for reporting this issue: https://github.com/MichaIng/DietPi/issues/2912#issuecomment-532100542
+- Rock64/RockPro64 | Resolved an issue where DietPi could not obtain the active network adapter and IP, if onboard Ethernet was used. This is because of a kernel-related bug, which seems to cause Ethernet connection instabilities as well in cases. A workaround is applied to all new Rock(Pro)64 images and via DietPi-Update. Many thanks to @svh1985 for reporting this issue, as well as searching and testing the workaround: https://github.com/MichaIng/DietPi/issues/3066
+- DietPi-Update | Resolved an issue where the script did not exit on error: https://github.com/MichaIng/DietPi/issues/3127
+- DietPi-Login | Resolved an issue during first run setup, where DietPi-Software was called with mostly wrong whiptail menu dimensions. This lead to info prompts and menus being quite small, in particular the "Install" menu entry, that one needs to select, being only visible when navigating to the bottom. Many thanks to @pbecks1963 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3053
+- DietPi-NordVPN | Resolved an issue where the server menu could have wrong entries or even fail, if foreign files were placed inside the config directory. Many thanks to @svh1985 for reporting this issue and implementing a fix: https://github.com/MichaIng/DietPi/pull/3047
+- DietPi-Run_NTPD | Resolved an issue where changing time sync mode or mirror, from within time sync error prompt, led to a concurrent script execution. Many thanks to @Sopor for reporting this issue: https://github.com/MichaIng/DietPi/issues/3010
+- DietPi-Services | Resolved an issue where single service calls failed if their names contain certain special characters, like dots. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3059
+- DietPi-Config | Resolved an issue on RPi where I2C baudrate was not applied correctly, thus selection was ineffective. Many thanks to @flashspys for reporting this issue: https://github.com/MichaIng/DietPi/issues/2966
+- DietPi-Config | Resolved an issue on RPi where headless mode did not disable all video outputs and framebuffer as intended, since the used config.txt setting has been removed with recent firmware versions.
+- DietPi-Config | Resolved an issue on RPi4 where SDTV/composite video output did not happen when selecting the related resolution menu entries.
+- DietPi-Config | On RPi4, vc4-kms-v3d option has been removed from display resolution menu, since the full KMS driver is not supported on RPi4 currently.
+- DietPi-Software | Resolved an issue where the script tells you that SQLite will be installed as pre-req, while actually a desktop is required and LXDE will be installed.
+- DietPi-Software | X11/Kodi on Odroid C2: Resolved an issue on Odroid C2 where Kodi failed to start. GPU drivers and X11 config will be updated during DietPi-Update to cover this issue. Many thanks to @alexeylutskov for reporting this issue and testing the fix: https://github.com/MichaIng/DietPi/issues/3028
+- DietPi-Software | Kodi: Resolved an issue where Kodi failed on RPi Buster and RPi4. Many thanks to @GulyFMG, @derdershat and @jonyskids for reporting this issue, searching and testing workarounds: https://github.com/MichaIng/DietPi/issues/3031
+- DietPi-Software | Gitea: Resolved an issue where install fails on ARMv7 systems. Many thanks to @maschiw for reporting this issue: https://github.com/MichaIng/DietPi/issues/2959
+- DietPi-Software | Node-RED: Resolved an issue where install fails due to missing data dir creation. Many thanks to @Orfait for reporting this issue: https://github.com/MichaIng/DietPi/issues/2975
+- DietPi-Software | Node-RED: Resolved an issue where user creation fails if "gpio" group is not present. Many thanks to @marcobrianza for reporting this issue: https://github.com/MichaIng/DietPi/issues/2975#issuecomment-513917360
+- DietPi-Software | OpenVPN: Resolved an issue where install failed on Debian Buster due to a new easy-rsa version with changed commands and options. Now the most recent easy-rsa is manually downloaded on all systems to generate server and client key + cert with modern methods and the client config is slightly updated to match modern settings.
+- DietPi-Software | XRDP: On Stretch, new the version from backports is installed. This resolves a critical issue where /etc/profile was not loaded to the session and, due to incomplete $PATH variable, important system binaries were not available on terminal emulators which broke many install and upgrade tasks. Furthermore this resolves an issue where install and connection of XRDP failed if IPv6 was disabled. Many thanks to @aspinks for the debug session which allowed us to track the issue down to its root: https://github.com/MichaIng/DietPi/issues/3017
+- DietPi-Software | Sonarr: Resolved an issue where install failed due to an outdated APT repository key. Many thanks to @GregoryDosh and @GulyFMG for reporting this issue: https://github.com/MichaIng/DietPi/issues/3029
+- DietPi-Software | Plex Media Server: Resolved an issue where DietPi-Update failed for versions prior to v6.23, due to the obsolete Plex Media Server dev2day repository being offline now. This repo is now removed via pre-patches, prior to G_AGUP being called. During regular patches PMS is reinstalled, applying the new official APT repo. Many thanks to @p-roman for reporting this issue: https://github.com/MichaIng/DietPi/issues/3038
+- DietPi-Software | Pi-hole: Resolved an issue, where the blocking page was only shown, if the blocked URL contained the domain only, without any appending path: https://github.com/MichaIng/DietPi/pull/3072
+- DietPi-Software | TigerVNC: Resolved an issue on Debian Buster, where the VNC connection fails immediately due to an external bug, if no read-only password has been applied via vncpasswd. Many thanks to @Trunkzeh for reporting this issue and providing the workaround: https://github.com/MichaIng/DietPi/issues/3070
+- DietPi-Software | TigerVNC: Resolved minor error messages on login and in logs: "No session for PID ...", "DE is (null); No desktop environnement set, fallback to LXDE", "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver"
+- DietPi-Software | Netdata: Resolved an issue where install failed on Stretch systems. Many thanks to @Velociraptor85 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3062
+- DietPi-Software | Amiberry: Resolved an issue where install failed on Buster due to changed library package version. The SDL2 library has been recompiled for Buster with minimal dependencies, thus X11 does not need to be installed anymore. Many thanks to @TuKo1982 for reporting this issue: https://github.com/MichaIng/DietPi/issues/3104
+
+As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/3162
+
+Known/Outstanding Issues:
+- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103
+- RPi | On TigerVNC virtual desktop, LXAppearance hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791
+- Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955
+- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584
+- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522
+- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073
+- DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747
+- DietPi-Software | MATE desktop: When logging in as root, desktop items and right-clock context menu is missing: https://github.com/MichaIng/DietPi/issues/3160
+
+For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues
+
+-----------------------------------------------------------------------------------------------------------
+
v6.25
(03/07/19)
@@ -7,7 +92,7 @@ Changes / Improvements / Optimisations:
- DietPi-FirstBoot | First boot setup steps have been moved into a separate script and systemd unit. This allows further cleanup of the regular boot process and more targeted debugging and development. Many thanks for @FredericGuilbault for implementing this enhancement: https://github.com/MichaIng/DietPi/issues/2791
- DietPi-Autostart | When choosing an autostart option that does not require a manual UNIX user login, the autologin user can now be chosen (which was always "root" previously). This can be applied automatically on firstrun setup with the new "AUTO_SETUP_AUTOSTART_LOGIN_USER" setting within dietpi.txt. If the user does not exist, is a system user (UID < 1000) or does not have a valid login shell, it will be reverted to root. Many thanks to @FredericGuilbault for suggesting this feature: https://github.com/MichaIng/DietPi/pull/2926
- DietPi-Globals | G_OBTAIN_CPU_TEMP(): Added support for Core2Duo CPU temperature to be printed on e.g. DietPi-Banner and "cpu" command output. Many thanks to @OstrovCity for posting the required information: https://github.com/MichaIng/DietPi/pull/2563#issuecomment-494388278
-- DietPi-Service 2.0 | Combines dietpi-process_tool into dietpi-services. Adds IO policies, single/global service control and much more: https://github.com/MichaIng/DietPi/pull/2786
+- DietPi-Service 2.0 | Combines dietpi-process_tool into dietpi-services. Adds I/O policies, single/global service control and much more: https://github.com/MichaIng/DietPi/pull/2786
- DietPi-Process_tool | Has been replaced with DietPi-Services. Existing saved options will no longer be available, please use 'dietpi-services' to apply required process_tool options with the upgraded system.
- DietPi-Explorer | Disabled opening of files in nano under select a file/folder mode.
- DietPi-Drive_Manager | Added the option to change the I/O scheduler per drive. Many thanks to @Generator for pointing us onto this topic: https://github.com/MichaIng/DietPi/issues/2233
@@ -21,7 +106,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | FFmpeg: On RPi, the new APT repo package will be installed, which now supports RPi hardware acceleration and is some subversion newer then the package hosted on dietpi.com: https://github.com/MichaIng/DietPi/issues/869#issuecomment-490047405
- DietPi-Software | Gitea: Current stable v1.8.X will be installed now and existing instances will be upgraded during DietPi-Update. Many thanks to @msongz for implementing this: https://github.com/MichaIng/DietPi/pull/2881
- DietPi-Software | myMPD: Current upstream version will be installed now and existing instances will be upgraded during DietPi-Update, which requires a config file reset. A backup to recover custom settings from will be created: https://github.com/MichaIng/DietPi/issues/2156#issuecomment-497513129
-- DietPi-Software | O!MPD: Current upstream version will be installed now and existing instances will be upgraded during DietPi-Update. Existing config and database will be preserved. YouTube and Tidal support is added now by default. Many thanks to @ArturSierzant for giving valueable feedback and suggestions: https://github.com/MichaIng/DietPi/pull/2884
+- DietPi-Software | O!MPD: Current upstream version will be installed now and existing instances will be upgraded during DietPi-Update. Existing config and database will be preserved. YouTube and Tidal support is added now by default. Many thanks to @ArturSierzant for giving valuable feedback and suggestions: https://github.com/MichaIng/DietPi/pull/2884
- DietPi-Software | Ampache: Reinstalls will now preserve existing configs and database.
- DietPi-Software | Medusa: mediainfo is now installed to enable Medusa gathering meta data and resolving related warnings in log. Additionally, on Stretch and above, Python3 is now installed and used, as recommended by Medusa for a while. Many thanks to @bluesmoke for suggesting this enhancement: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5945
- DietPi-Software | Node-RED: "sudo" permissions are now enabled by default: https://github.com/MichaIng/DietPi/issues/2910
@@ -35,9 +120,9 @@ Bug Fixes:
- DietPi-PREP | Resolved an issue where ifupdown (networking service) was autoremoved, which broke running network connections.
- DietPi-Drive_Manager | Resolved an issue where idle spin down selection would always default to 241, instead of currently active value: https://github.com/MichaIng/DietPi/issues/2852
- DietPi-Drive_Manager | Resolved an issue where eCryptfs fstab entries were not detected and preserved correctly. Many thanks to @johnvick for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=18428#p18283
-- DietPi-Drive_Manager | Resolved an issue where transferring the RootFS to a BTRFS formated drive fails. Since BTRFS support is not natively built into the RPi and Odroid kernel, a warning prompts and the transfer is aborted. Many thanks to @dieitpi for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=18164#p18164
+- DietPi-Drive_Manager | Resolved an issue where transferring the RootFS to a BTRFS formatted drive fails. Since BTRFS support is not natively built into the RPi and Odroid kernel, a warning prompts and the transfer is aborted. Many thanks to @dieitpi for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?p=18164#p18164
- DietPi-Drive_Manager | Resolved an issue where on x86_64 systems a specific Seagate drive, attached via USB, does not spin down on idle. Many thanks to @tomillr for reporting this issue: https://github.com/MichaIng/DietPi/issues/2905
-- DietPi-Config | (RPi) Resolved an issue where selecting sound cards with vc4 enabled would result with incorrect alsa card index: https://github.com/MichaIng/DietPi/issues/2173
+- DietPi-Config | (RPi) Resolved an issue where selecting sound cards with vc4 enabled would result with incorrect ALSA card index: https://github.com/MichaIng/DietPi/issues/2173
- DietPi-Config | Resolved an issue where selecting any locale (language) failed, which does not contain "UTF-8" in its name. DietPi only supports UTF-8 locales, but those available with UTF-8 only, do not have the ".UTF-8" suffix in their name.
- DietPi-Software | Resolved an issue on Buster systems that were dist-upgraded manually from Stretch, where DietPi-Software failed to obtain the global software password. Many thanks to @MattL0 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2937
- DietPi-Software | Resolved an issue where audio software failed to use hardware acceleration on Buster. Users need to be part of the new "render" group on Buster to have permissions. Many thanks to @tomillr for reporting this issue: https://github.com/MichaIng/DietPi/issues/2916
@@ -49,17 +134,6 @@ Bug Fixes:
As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/2950
-Known/Outstanding Issues:
-- DietPi-Config | Enabling WiFi + Ethernet adapters, both on different subnets, breaks WiFi connection in some cases: https://github.com/MichaIng/DietPi/issues/2103
-- RPi | LXAppearance (on LXDE desktop) hangs on dbus-launch: https://github.com/MichaIng/DietPi/issues/1791
-- Odroid C2 | Some WiFi adapters do no work as hotspot: https://github.com/MichaIng/DietPi/issues/1955
-- Odroid XU4 | Kodi freezes shortly on video playback: https://github.com/MichaIng/DietPi/issues/2584
-- Rock64 | 3.5mm A/V jack is currently not functional: https://github.com/MichaIng/DietPi/issues/2522
-- DietPi-Software | Node-RED: Pre-installed modules cannot be updated via web UI: https://github.com/MichaIng/DietPi/issues/2073
-- DietPi-Software | Raspimjpeg: With Lighttpd, streaming mjpeg does not work: https://github.com/MichaIng/DietPi/issues/1747
-
-For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues
-
-----------------------------------------------------------------------------------------------------------
v6.24.1
@@ -67,7 +141,7 @@ v6.24.1
Bug Fixes:
- DietPi-WiFi-Monitor | Resolved an issue where the service leads to a constant high CPU load. Many thanks for @GulyFMG for reporting this issue: https://github.com/MichaIng/DietPi/issues/2802
-- DietPi-Software | PHP: On ARMv6, fine tuned the required Buster branch priority pins to avoid certain ATP dependency errors. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2808, https://github.com/MichaIng/DietPi/issues/2811
+- DietPi-Software | PHP: On ARMv6, fine tuned the required Buster branch priority pins to avoid certain APT dependency errors. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2808, https://github.com/MichaIng/DietPi/issues/2811
- DietPi-Software | Lighttpd: Resolved an issue where Lighttpd fails to start on ARMv6. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2808
As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/2819
@@ -106,11 +180,11 @@ Buster support:
Changes / Improvements / Optimisations:
- DietPi-Banner | Added support for DietPi message of the day (MOTD). This is enabled by default, however, can be disabled. Checks for latest MOTD once a day.
- DietPi-Banner | Always prints the local IP during boot mode display: https://github.com/MichaIng/DietPi/issues/2681
-- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime IO with priority 0 (highest).
+- DietPi-Benchmark | Increased default survey RootFS and RAM benchmark sizes. 100MB (from 10MB) for RootFS. RAM is 1/4 of available. This is ensure a more accurate calculation of throughput when we divide bytes against time, to obtain the MB/s result. Benchmarks now also run at Nice -19 and realtime I/O with priority 0 (highest).
- DietPi-Cleaner | Added a confirmation prompt, before removal of offline docs and man pages, as this may cause APT issues in some circumstances. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/2751
- DietPi-LetsEncrypt | When applying to Lighttpd, "webroot" authentication is now used instead of "standalone". This allows the auto-renewal service to succeed while Lighttpd is running. Many thanks to @minnux for testing this method: https://github.com/MichaIng/DietPi/issues/2680#issuecomment-480095449
- DietPi-Arr_to_RAM | With v6.18 we silently added a new script (for Stretch and above) that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files. This script has gone through some rework and polishing and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown. For more details read: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828. Many thanks to @Dr0bac for providing valuable input and testing the development progress constantly: https://github.com/MichaIng/DietPi/issues/2689
-- DietPi-Drive_Manager | encryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202
+- DietPi-Drive_Manager | eCryptfs and vboxsf (VirtualBox shared folder) fstab entries are now preserved. Many thanks to @johnvick and @Phil1988 for suggesting: https://github.com/MichaIng/DietPi/issues/2078, https://github.com/MichaIng/DietPi/issues/2202
- DietPi-PREP | The script execution can now be fully automated via environment variables. Many thanks to @FredericGuilbault for adding this feature: https://github.com/MichaIng/DietPi/pull/2756
- DietPi-Config | Added support to toggle Intel CPU turbo/boost mode. Requires Intel CPU that supports the feature.
- DietPi-Config | G_CHECK_URL: Added ability to change the connection attempts and timeout, before DietPi URL checking assumes a dead link and failure: https://github.com/MichaIng/DietPi/issues/2717
@@ -125,7 +199,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | Plex Media Server: All systems are migrated to the new official APT repository. This allows easy and consistent upgrades via APT. On ARM systems the until now used 3rd party dev2day repo receives no further updates and will be shut down soon, which makes the migration mandatory. Many thanks to @WolfganP for keeping us informed with news about Plex v1.15 and the new APT repo: https://github.com/MichaIng/DietPi/issues/2655
- DietPi-Software | Logitech Media Server: Now installs the latest nightly version, since no public "releases" are done. As well the systemd service has gone through some update and now runs as limited user to align with other media servers, enhance security and follow the defaults of the DPKG package. The update/change is applied to existing installs via DietPi-Update as well. Your settings/date are preserved.
- DietPi-Software | Nextcloud Talk: We do not apply (D)TLS settings to coTURN any more. Since WebRTC is encrypted by itself there is no security benefit. More importantly Nextcloud Talk does not make use of the required TURNS protocol, so there is absolutely no point to apply these settings. The (D)TLS feature is meant to allow passing firewalls that only allow encrypted traffic. WebRTC, although encrypted, might not pass such firewalls since the encryption is not on transport layer. For those how are interested in further details and discussion: https://github.com/coturn/coturn/issues/33, https://github.com/nextcloud/spreed/issues/257
-- DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. Systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762
+- DietPi-Software | SABnzbd: Install latest version via GitHub master and skip adjusting existing config file. systemd unit and dependencies have been adjusted to match minimum requirements and official documentation. The update will be applied via DietPi v6.23 patch as well. Many thanks to @19eighties for reporting the outdated version: https://github.com/MichaIng/DietPi/issues/2762
- DietPi-Software | Jackett: On non-ARMv6 devices the new (v0.11+) standalone (non-mono) binary is installed now. This is applied on DietPi-Update as well, preserving your settings: https://github.com/MichaIng/DietPi/pull/2773
- DietPi-Software | Blynk: Enabled support for Debian Buster by using the new Java 11 binary.
- DietPi-Software | UrBackup: New version 2.3.8 is installed now. Many thanks to @DeathIsUnknown for informing us about the update: https://github.com/MichaIng/DietPi/issues/2783
@@ -138,7 +212,7 @@ Bug Fixes:
- DietPi-Login | Resolved an issue where login as non-root user could result in a "sudo" password prompt or endless failure loop due to missing sudo permissions. Many thanks to @xsak for reporting this issue: https://github.com/MichaIng/DietPi/issues/2667
- DietPi-Software | Emby Server: Resolved an issue where download failed if the latest release does not contain a Debian package. Many thanks to @niblettr for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5755
- DietPi-Software | Transmission: Resolved an issue where double quotes in global software password caused a service startup failure. Many thanks to @Drew80 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2484#issuecomment-480675168
-- DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thats to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691
+- DietPi-Software | WireGuard: Resolved an issue where IPv6 connections did not work with enabled IPv6 forwarding. Many thanks to @schnuckz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2691
- DietPi-Software | Subsonic: Resolved an issue where FFmpeg transcoder might not have been applied correctly. Many thanks to @spectrumcomputing for reporting this issue: https://github.com/MichaIng/DietPi/issues/2697
- DietPi-Software | AmiBerry: Resolved an issue where no login prompt was present when exiting AmiBerry from fastboot mode. Many thanks to @Trigger58 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2703#issuecomment-482471440
- DietPi-Software | Logitech Media Server: Resolved an issue where certain plugins failed due to missing "libio-socket-ssl-perl". Many thanks to @noobian and @Edward for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5824
@@ -192,7 +266,7 @@ Bug Fixes:
- DietPi-Config | RPi: Resolved an issue where I-Sabre-K2M sound card selection failed. Thanks to @klasLiesen for reporting this issue: https://github.com/MichaIng/DietPi/issues/2547
- DietPi-Config | RPi: Resolved an issue where serial console must be disabled, for Bluetooth to function correctly. This is now done automatically during BT enable: https://github.com/MichaIng/DietPi/issues/2607
- DietPi-Config/Banner | Resolved an issue where wrong adapter state is shown if it is not connected but has an IP assigned. Thanks to @msongz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2573
-- DietPi-Drive_Manager | Resolved an issue where RootFS RO would not remain during reboots. Many thanks to @JBatSEEDLING for reporting this issue: https://github.com/MichaIng/DietPi/issues/2604
+- DietPi-Drive_Manager | Resolved an issue where RootFS R/O would not remain during reboots. Many thanks to @JBatSEEDLING for reporting this issue: https://github.com/MichaIng/DietPi/issues/2604
- DietPi-Software | XU4 + X11: Resolved various issues related to incorrect xorg.conf settings on this device. xorg.conf now used is installed automatically from Meveric's repo, which auto detects 3.x and 4.x kernel configuration and required settings automatically: https://github.com/MichaIng/DietPi/issues/2584 + https://github.com/MichaIng/DietPi/issues/2351
- DietPi-Software | MineOS/Koel: Resolved an issue where installs on ARMv8 devices failed. Many thanks to @DeathIsUnknown for reporting this issue and providing the solution: https://github.com/MichaIng/DietPi/issues/1880#issuecomment-464097174
- DietPi-Software | GMediaRender: Resolved an issue where the daemon can attach to a wrong IP if multiple network devices are present. As well resolved a failing service start on fresh install if/as the log file does not yet exist. Many thanks to @WilburWalsh for reporting these issues and providing the fix: https://github.com/MichaIng/DietPi/issues/2576
@@ -240,7 +314,7 @@ Image line-up:
Changes / Improvements / Optimisations:
- DietPi-PREP | Removed the option to install a Jessie system. Removed the option to install DietPi on top of a Wheezy image, since an upgrade over two distro version would be required, which is not reliable. It is still possible to install DietPi on top of a Jessie image, where a distro upgrade to Stretch would be applied: https://github.com/MichaIng/DietPi/issues/2332
-- General | RPi-Update: In our effort to improve system stability, and, offer software installations which build custom modules (eg: WireGuard), we can not longer support systems with non-stock APT kernel installed. If "rpi-update" is installed during update, DietPi will prompt and return you back to stock APT kernel.
+- General | RPi-Update: In our effort to improve system stability, and, offer software installations which build custom modules (e.g. WireGuard), we can not longer support systems with non-stock APT kernel installed. If "rpi-update" is installed during update, DietPi will prompt and return you back to stock APT kernel.
- General | Moved the remaining conf/* files located on DietPi-RAMdisk to /var/lib/dietpi or into DietPi-PREP, and removed /DietPi/dietpi/conf completely. These files were only used once or never, thus have no business inside the RAMdisk.
- DietPi-Config | RPi: Improved available options for HDMI boost setting: https://github.com/MichaIng/DietPi/issues/2350
- DietPi-Config | RPi: Headless display mode is now applied via undocumented config.txt setting. Removed/Replaced some other obsolete config.txt entries: https://github.com/MichaIng/DietPi/pull/2402
@@ -256,7 +330,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | Nextcloud Talk: Disabled the very verbose coturn logging by default to reduce disk I/O. This can be overridden via /etc/turnserver.conf: https://github.com/MichaIng/DietPi/issues/2321
- DietPi-Software | Deluge: UMask 002 applied to all downloads: https://github.com/MichaIng/DietPi/issues/2339
- DietPi-Software | Netdata: Updated to v1.11.1 and now runs as user "netdata": https://github.com/MichaIng/DietPi/pull/2337
-- DietPi-Software | ownCloud/Nextcloud: Updated webserver configs to match current recommendations and security hardenings. Only applied on new installs. To apply manually, run "dietpi-software reinstall 47" (owncloud) or "dietpi-software reinstall 114" (Nextcloud). You will be informed about the new configs, which then need to be manually moved to overwrite the old ones, since we don't want to mess with manual changes: https://github.com/MichaIng/DietPi/pull/2361
+- DietPi-Software | ownCloud/Nextcloud: Updated webserver configs to match current recommendations and security hardenings. Only applied on new installs. To apply manually, run "dietpi-software reinstall 47" (ownCloud) or "dietpi-software reinstall 114" (Nextcloud). You will be informed about the new configs, which then need to be manually moved to overwrite the old ones, since we don't want to mess with manual changes: https://github.com/MichaIng/DietPi/pull/2361
- DietPi-Software | OpenSSH: Host keys won't be recreated anymore on reinstall, only on first boot of a fresh image, using now "dpkg-reconfigure openssh-server" to generate default key types based on distro.
- DietPi-Software | Dropbear: Now installs only the "dropbear-run" package on Stretch (and above), which matches the default DietPi setup on our images and PREP script.
- DietPi-Software | NAA Daemon: Updated to 3.5.5-39. Thanks to @volpone for the heads up: https://github.com/MichaIng/DietPi/issues/2387#issue-395321320
@@ -279,7 +353,7 @@ Bug Fixes:
- DietPi-Software | Nextcloud: Resolved an issue, where the Nextcloud Apache config was not downloaded correctly. Thanks to @Stefan3v for reporting this issue: https://github.com/MichaIng/DietPi/issues/2383
- DietPi-Software | ownCloud/Nextcloud (Talk): Resolved an issue, where occ/ncc commands could fail, if Redis server is not running: https://github.com/MichaIng/DietPi/issues/2321
- DietPi-Software | ownCloud/Nextcloud: Resolved an issue, where during fresh installs on v6.19, Apache configs were not enabled correctly.
-- DietPi-Software | MPD: Resolved an issue on Stretch, where the mpd binary could not find the configuration file without giving it explicitely as argument. Thanks to @mfeif for reporting this issue: https://github.com/MichaIng/DietPi/issues/2378
+- DietPi-Software | MPD: Resolved an issue on Stretch, where the mpd binary could not find the configuration file without giving it explicitly as argument. Thanks to @mfeif for reporting this issue: https://github.com/MichaIng/DietPi/issues/2378
- DietPi-Software | Mopidy: Resolved an issue, where playlist files could not be created due to missing permissions. Further improved handling of existing configs, data and cache directories on (re)install. Thanks to @cyberlussi for reporting this issue: https://github.com/MichaIng/DietPi/issues/2384
- DietPi-Software | Deluge: Resolved a visual-only error in systemd unit, since same-line comments are not allowed anymore. Thanks to @Gabba for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=5378
- DietPi-Software | No-IP: Fixed an issue, where on "Generic device" (ID 22), the wrong binary could have been installed. As well added failsafe "/usr/local/[bin|etc]" directory pre-creation, in case not present on the system or manually removed by user. Thanks to @walker93 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2426
@@ -350,14 +424,14 @@ Changes / Improvements / Optimisations:
- General | Concurrent execution detection: Now has a 5 second buffer to wait for exit (G_INIT_WAIT_CONCURRENT), before failing: https://github.com/MichaIng/DietPi/issues/2159#issuecomment-433619721
- DietPi-Config | Added support for changing the brightness of the RPi touchscreen: https://github.com/MichaIng/DietPi/issues/2169
- DietPi-Config | Added support for setting Xorg DPI scale.
- - DietPi-Services | MariaDB: DietPi now uses the pre-installed "mariadb" systemd service instead of obsoleve "mysql" init.d service: https://github.com/MichaIng/DietPi/pull/2196
+ - DietPi-Services | MariaDB: DietPi now uses the pre-installed "mariadb" systemd service instead of obsolete "mysql" init.d service: https://github.com/MichaIng/DietPi/pull/2196
- DietPi-Software | Nextcloud Talk video calls with configured TURN server is now available for install: https://github.com/MichaIng/DietPi/pull/2197
- DietPi-Software | NAA Daemon: Added installation support for ARMv8 and x86_64. Thanks Jussi!
- DietPi-Software | Pi-hole: During (re)install you can now decide whether to show a blocking page to clients or not: https://github.com/MichaIng/DietPi/issues/2007
- DietPi-Software | MotionEye: Now available to install for all devices. Removed support from Jessie: https://github.com/MichaIng/DietPi/issues/2229
- DietPi-Software | G_BACKUP_FP: New feature rolled out to MPD and web server base DietPi-Software installations, in which config files are backed up before DietPi overwrites them: https://github.com/MichaIng/DietPi/issues/2187#issuecomment-433626639
- DietPi-Software | SickRage: Is no longer available for installation. We will asses a replacement in v6.19. Sonarr is an excellent alternative with faster performance and stability.: https://github.com/MichaIng/DietPi/issues/2239
- - DietPi-Software | Docker: Now runs under 'simple' service type (previously 'notify'), to prevent service start delay which can occur on ARM based devices (eg: RPi), from delaying other applications starting on the system: https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766
+ - DietPi-Software | Docker: Now runs under 'simple' service type (previously 'notify'), to prevent service start delay which can occur on ARM based devices (e.g. RPi), from delaying other applications starting on the system: https://github.com/MichaIng/DietPi/issues/2238#issuecomment-439474766
- DietPi-Software | Mosquito: Service updated to systemd: https://github.com/MichaIng/DietPi/issues/2243
- DietPi-Software | Radarr/Sonarr/Lidarr: logs (both .txt and .db*) have been moved to DietPi-RAMlog: https://github.com/MichaIng/DietPi/issues/2223
- DietPi-Software | Pydio: WebUI warnings (security, performance) are now resolved for Nginx and Lighttpd webservers as well. Separate config files are created instead of touching the defaults, to enable required settings for Pydio only. Required PHP modules are installed and enabled, to be failsafe. Preserve existing install dirs on (re)install and inform user to update via WebUI updater: https://github.com/MichaIng/DietPi/issues/1913
@@ -366,31 +440,31 @@ Changes / Improvements / Optimisations:
- DietPi-Software | Tautulli: Install enabled for ARMv8 devices.
Bug Fixes:
- - PREP: Resovled an issue where master.zip would always be downloaded, regardless of selected branch.
+ - PREP: Resolved an issue where master.zip would always be downloaded, regardless of selected branch.
- PREP: Resolved failed rootFS resize: https://github.com/MichaIng/DietPi/issues/2181#issuecomment-433715556
- General | Resolved various gwtcwd errors during boot and software installations on VM: https://github.com/MichaIng/DietPi/issues/2237
- General | NanoPi Fire3: Resolved an issue with blank HDMI output. Device is now switched to tty2 during boot, as a workaround/fix due to tty1 failing: https://github.com/MichaIng/DietPi/issues/2225
- General | Resolved an issue, where entering passwords via our internal whiptail password box leads to "invalid match", when special characters are used, forcing a retry: https://github.com/MichaIng/DietPi/issues/2215#issuecomment-437683709
- DietPi-Cleaner | Resolved an issue where test runs on -dev package removal, would remove the packages.
- DietPi-Cleaner | Resolved a syntax error with function 'Run_Cleaners', disabling the ability to run cleaners. Many thanks to @optio50 for reporting this issue! https://github.com/MichaIng/DietPi/issues/2241
- - DietPi-Config | Resovled an visual error when selecting network options due to 'G_CHECK_VALIDINT'.
+ - DietPi-Config | Resolved an visual error when selecting network options due to 'G_CHECK_VALIDINT'.
- DietPi-Config | Locale: Resolved an issue where DietPi would always display en_GB as the current locale: https://github.com/MichaIng/DietPi/issues/2216#issuecomment-435599419
- DietPi-Config | Resolved an issue where on Odroid C1/2 with current kernel 3.5" LCD shield does not work anymore. Thanks to @Kreeblah for reporting this issue and solution: https://github.com/MichaIng/DietPi/issues/2256
- DietPi-Automation | CONFIG_NTP_MODE is now applied after APT cache, and, initial time sync is updated. Due to packages required for some modes: https://github.com/MichaIng/DietPi/issues/2181#issuecomment-433444882
- DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, if service was already running previously but not installed via APT (mostly in backup/restore situations): https://github.com/MichaIng/DietPi/pull/2277/#issuecomment-441461982
- - DietPi-Software | Kodi: Resolved an issue where restart/shutdown options were not visable, due to lack of systemd-logind: https://github.com/MichaIng/DietPi/issues/2155
- - DietPi-Software | Mono applications (Radarr/Sonarr/Lidarr/Jackett): Rolled out "-O=-aot" (ahead of time optimzation) to all applications, which resolves a known external bug with recent Mono update. Many thanks to @Generator for testing and confirming this issue: https://github.com/MichaIng/DietPi/issues/2219#issuecomment-437594645
+ - DietPi-Software | Kodi: Resolved an issue where restart/shutdown options were not visible, due to lack of systemd-logind: https://github.com/MichaIng/DietPi/issues/2155
+ - DietPi-Software | Mono applications (Radarr/Sonarr/Lidarr/Jackett): Rolled out "-O=-aot" (ahead of time optimisation) to all applications, which resolves a known external bug with recent Mono update. Many thanks to @Generator for testing and confirming this issue: https://github.com/MichaIng/DietPi/issues/2219#issuecomment-437594645
- DietPi-Software | Roon Bridge: Resolved an issue where the remote update would fail due to underpriv permissions: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/6
- DietPi-Software | Nextcloud: Resolved an issue with failed installation: https://github.com/MichaIng/DietPi/issues/2184
- - DietPi-Software | Nextcloud/Owncloud: Resolved an issue where userdata located on external drive would fail the installation: https://github.com/MichaIng/DietPi/issues/2221
- - DietPi-Software | OMPD/MyMPD: Resolved inability to update database. Currently we have rolled back the versions of these programs to a working state. We will investigate with the devs to find out the cause for future release: https://github.com/MichaIng/DietPi/issues/2156
+ - DietPi-Software | Nextcloud/ownCloud: Resolved an issue where userdata located on external drive would fail the installation: https://github.com/MichaIng/DietPi/issues/2221
+ - DietPi-Software | OMPD/myMPD: Resolved inability to update database. Currently we have rolled back the versions of these programs to a working state. We will investigate with the devs to find out the cause for future release: https://github.com/MichaIng/DietPi/issues/2156
- DietPi-Software | Jackett: Resolved an issue where reinstall created an additional nested install dir. Thanks @msdos for reporting this issue: https://github.com/MichaIng/DietPi/issues/2212
- DietPi-Software | RoonServer: Resolved an issue where reinstall created an additional nested install dir. Since RoonServer has an automated internal updater, download and install will be skipped, if install already exists.
- DietPi-Software | PHP/databases: Resolved an issue where PHP database modules were not installed, when installing a new database and PHP was already installed before.
- DietPi-Software | PHP: On Buster, moved to PHP7.3, since php-apcu and php-redis are not available for PHP7.2 any more. This resolves both PHP versions being installed concurrently.
- DietPi-Software | OpenBazaar: Resolved an issue where remote OB clients could not connect to server with default configuration: https://github.com/MichaIng/DietPi/pull/2224
- DietPi-Software | Resolved an issue where a global password with special characters lead to failing installs, due to missing escaping within our internal function G_CONFIG_INJECT. Thanks to @MistahDarcy for reporting this issue: https://github.com/MichaIng/DietPi/issues/2215
- - DietPi-Software | Docker: Resolved an issue where the Docker daemon failes to start due to invalid command argument. Thanks to @mspieth376 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2238
+ - DietPi-Software | Docker: Resolved an issue where the Docker daemon fails to start due to invalid command argument. Thanks to @mspieth376 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2238
- DietPi-Software | Grafana: Resolved an issue, where WebUI password is not applied correctly, when containing ";" or "#". Thanks to @Warmbadger for reporting this issue and solution: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5248
- DietPi-Software | Tautulli: Resolved an issue where Tautulli service failed to start up. As well improved reinstall, if install dir is already existent. Thanks to @Comfubar for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?f=11&t=5256
- DietPi-Obtain_network_details | Resolved a tiny visual-only error message on non-root logins. Thanks to @AndrewZ for reporting: https://dietpi.com/phpbb/viewtopic.php?f=9&t=5194
@@ -404,10 +478,10 @@ v6.17
(25/10/18)
Changes / Improvements / Optimisations:
- - General | NanoPC T4: Image updated to include lastest kernel (4.4.154). Many thanks to @carlosedp for providing this kernel! https://github.com/MichaIng/DietPi/issues/1829#issuecomment-429324437
+ - General | NanoPC T4: Image updated to include latest kernel (4.4.154). Many thanks to @carlosedp for providing this kernel! https://github.com/MichaIng/DietPi/issues/1829#issuecomment-429324437
- General | DietPi now has 3 branches (master=stable, beta=public testing, dev=dev). By default, all users are on master/stable branch: https://github.com/MichaIng/DietPi/issues/2083#issuecomment-426842537
- General | Improved detection of permissions support during user data transfers: https://github.com/MichaIng/DietPi/issues/2096
- - General | IPv6: Due to the requirements of various software titles available in dietpi-software (eg: nginx, redis-server), and that IPv6 is slowly becoming more common place, IPv6 is now disabled via sysctl on interface level, while it stays enabled on kernel level: https://github.com/MichaIng/DietPi/issues/2027
+ - General | IPv6: Due to the requirements of various software titles available in dietpi-software (e.g. Nginx, Redis), and that IPv6 is slowly becoming more common place, IPv6 is now disabled via sysctl on interface level, while it stays enabled on kernel level: https://github.com/MichaIng/DietPi/issues/2027
- DietPi-Autostart | Chromium: You will now be prompted to enter a homepage URL, which will be loaded when the application starts: https://github.com/MichaIng/DietPi/issues/2169#issuecomment-432297343
- DietPi-Config | RPi: Added support for LCD panel "Elecrow ESP01215E 7 inch HDMI IPS with touch input" (basically a cheaper RPi touchscreen): https://www.amazon.co.uk/gp/product/B07H79XMLT/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1
- DietPi-Config | Added ability to benchmark network LAN transfer rates using 2 DietPi systems.
@@ -416,17 +490,17 @@ Changes / Improvements / Optimisations:
- DietPi-Config | Online Benchmarks Database! Now available. Simply run the benchmark from the tools menu, to upload your scores and compare against others: https://dietpi.com/survey
- DietPi-Automation | Added settings to dietpi.txt to toggle IPv6 and IPv4 preference on first boot.
- DietPi-Update | You now have the option to view the changelog, prior to updating: https://github.com/MichaIng/DietPi/issues/2081
- - DietPi-Software | Sabnzbd: Updated to 2.3.5 for new installations only. Now runs under its own limited user account, and, umask of 0775 for downloads: https://github.com/MichaIng/DietPi/issues/2172
+ - DietPi-Software | SABnzbd: Updated to 2.3.5 for new installations only. Now runs under its own limited user account, and, umask of 0775 for downloads: https://github.com/MichaIng/DietPi/issues/2172
- DietPi-Software | Card/CalDAV request redirection was added to new Baikal, ownCloud and Nextcloud installs. Now only the servers domain/IP need to be entered on Card/CalDAV clients, without any further path to the DAV endpoints: https://github.com/MichaIng/DietPi/issues/2057
- DietPi-Software | Plex Media Server and Transmission services run now as group "dietpi", to allow cross access with download managers and media software: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-427579779
- DietPi-Set_Hardware | Odroid C2: When selecting USB DAC, smp affinity will be applied for USB IRQ's to improve stability: https://github.com/MichaIng/DietPi/issues/2101
- - DietPi-Drive_Manager | Formatting: Now has the option to format the whole drive, or patition only, for drives with existing partitions.
- - DietPi-Drive_Manager | Mounting NTFS drives now enabled native linux permissions support (eg: you can use this as your userdata location). Many thanks to @Random90 for making this possible! https://github.com/MichaIng/DietPi/issues/2096#issuecomment-425553333
+ - DietPi-Drive_Manager | Formatting: Now has the option to format the whole drive, or partition only, for drives with existing partitions.
+ - DietPi-Drive_Manager | Mounting NTFS drives now enabled native linux permissions support (e.g. you can use this as your userdata location). Many thanks to @Random90 for making this possible! https://github.com/MichaIng/DietPi/issues/2096#issuecomment-425553333
- DietPi-Drive_Manager | Improved detection and formatting for NVMe based drives: https://github.com/MichaIng/DietPi/issues/2102
- DietPi-Drive_Manager | Removed /proc from fstab. No longer required as this created at kernel/systemd level: https://github.com/MichaIng/DietPi/issues/2154
Bug Fixes:
- - General | G_THREAD_START: Resolved issue where this was running in blocking mode. Now uses exit code to indentify finished tasks instead of PID.
+ - General | G_THREAD_START: Resolved issue where this was running in blocking mode. Now uses exit code to identify finished tasks instead of PID.
- DietPi-Cloudshell | Resolved various issues with inability to run service via SSH on another screen, and, G_DIETPI-NOTIFY errors. Many thanks to @potter-91 for reporting this issue! https://github.com/MichaIng/DietPi/issues/2104
- DietPi-Config | WiFi-Monitor: Resolved an issue with syntax, and, incorrectly pinging the default gateway, instead of whats assigned to the wlan interface: https://github.com/MichaIng/DietPi/issues/2103
- DietPi-Config | dietpi-wifi.db code has been optimized, and, also resolves an issue where '/var/lib/dietpi/dietpi-wifi.db' was not generated automatically: https://github.com/MichaIng/DietPi/issues/2087#issuecomment-423836528
@@ -438,8 +512,8 @@ Bug Fixes:
- DietPi-Software | Fixed an issue where software uninstalls could have failed due to dependant packages. Thanks to @dynobot for reporting this issue: https://github.com/MichaIng/DietPi/issues/2091
- DietPi-Software | Webservers/PHP: Fixed an issue, where PHP was not installed when a webserver was installed directly via "dietpi-software install 8X".
- DietPi-Software | Nextcloud: On Jessie systems, no newer version than latest NC13 will be installed, because PHP5 support was dropped with NC14: https://github.com/MichaIng/DietPi/issues/1778#issuecomment-419918372
- - DietPi-Software | MyMPD: Resolved an issue where the service would fail to run: https://github.com/MichaIng/DietPi/issues/2088
- - DietPi-Software | MyMPD: Resolved an issue where the installation would fail, due to a recent MyMPD update with new pre-reqs: https://github.com/MichaIng/DietPi/issues/2088#issuecomment-423852124
+ - DietPi-Software | myMPD: Resolved an issue where the service would fail to run: https://github.com/MichaIng/DietPi/issues/2088
+ - DietPi-Software | myMPD: Resolved an issue where the installation would fail, due to a recent myMPD update with new pre-reqs: https://github.com/MichaIng/DietPi/issues/2088#issuecomment-423852124
- DietPi-Software | SiCKRAGE: Resolved failing install due to changed capitalization of SiCKRAGE GitHub repo, and, various additional pre-reqs due to new install method required by SiCKRAGE. Thanks to @mdoary for reporting this issue: https://github.com/MichaIng/DietPi/issues/2126
- DietPi-Software | VNC Server: Resolved an issue where VNC server would fail to start under shared desktop mode, many thanks to @LieDanG for reporting this issue: https://github.com/MichaIng/DietPi/issues/2142#issuecomment-430492281
- DietPi-Process_tool | Resolved an issue where applying process settings on Plex Media Server failed, thanks to @symbios24 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2089
@@ -484,8 +558,8 @@ Changes / Improvements / Optimizations:
General | Changed Survey and Bugreport uploads to use ssh.dietpi.com (previously IP): https://github.com/MichaIng/DietPi/issues/2022#issuecomment-415470064
General | 1st run setup and dietpi-update logs are now created in RAM, then copied to disk once completed '/var/tmp/dietpi/logs/dietpi-firstrun-setup.log'. This will speed up 1st run setup installation for slow SBCs and/or rootFS.
General | PineA64: Image updated to v6.14, also contains the latest kernel/uboot by Ayufan (0.6.2): https://github.com/MichaIng/DietPi/issues/2026
-General | Resolved an isssue where the initial 1st run connection test would fail, if timesync had not yet completed, and, the SSL cert of the connection test site is not valid for current date on system: https://github.com/MichaIng/DietPi/issues/2039
-General| SparkySBC: Support for native DSD playback on iFi Pro iDSD. Many thanks @sudeep: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz
+General | Resolved an issue where the initial 1st run connection test would fail, if timesync had not yet completed, and, the SSL cert of the connection test site is not valid for current date on system: https://github.com/MichaIng/DietPi/issues/2039
+General | Sparky SBC: Support for native DSD playback on iFi Pro iDSD. Many thanks @sudeep: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz
DietPi-Backup/Sync | rsync transfer: Now shows progress information during the transfer: https://github.com/MichaIng/DietPi/issues/2044#issuecomment-417779406
DietPi-Backup | Added an option to delete the currently selected backup, if it exists.
DietPi-Config | Advanced Options: You can now toggle if a real RTC is installed. This adds/removes 'fake-hwclock' package installation as requested: https://github.com/MichaIng/DietPi/issues/2041
@@ -518,7 +592,7 @@ Changes / Improvements / Optimizations:
DietPi-Software | GLOBAL_PW: The global password used by DietPi-Software is now encrypted with AES-256, removed from '/boot/dietpi.txt' and stored securely on rootFS with root:root/700 access only: https://github.com/MichaIng/DietPi/issues/2021
DietPi-Software | FreshRSS, a self-hosted RSS feed aggregator, now available for installation. Thanks @msongz for requesting an RSS reader: https://github.com/MichaIng/DietPi/issues/1996
DietPi-Software | BruteFIR: Due to low install count (7), we have removed this software from the DietPi database, and, is no longer available for installation.
-DietPi-Software | NAA Daemon: Installation updated to 3.5.4-38. Thanks Volpone for the heads up!: https://dietpi.com/phpbb/viewtopic.php?f=11&t=4420
+DietPi-Software | NAA Daemon: Installation updated to 3.5.4-38. Thanks @Volpone for the heads up!: https://dietpi.com/phpbb/viewtopic.php?f=11&t=4420
General | '/etc/machine-id' is now unique for each DietPi installation. Regenerated during patch: https://github.com/MichaIng/DietPi/issues/2015
Bug Fixes:
@@ -536,14 +610,14 @@ v6.13
Changes / Improvements / Optimizations:
General | Sparky SBC: Added driver to support RTL8812AU WiFi based chipsets: https://github.com/sparky-sbc/sparky-test/tree/master/rtl8812au
-DietPi-Globals | G_THREAD_WAIT: Now displays errors for each thread, if they occured.
+DietPi-Globals | G_THREAD_WAIT: Now displays errors for each thread, if they occurred.
DietPi-Config | NTP mirror selection has been reworked. It allows now to add local and external non-pool.ntp.org servers and local gateway auto detection: https://github.com/MichaIng/DietPi/issues/1688
DietPi-Config | Display Options > Backlight Brightness: Now available for Intel compatible backlight devices.
DietPi-Explorer | Whiptail based, minimial/lightweight file explorer and manager now available for use!
DietPi-Services | You can now include custom services, and, exclude DietPi controlling services known to it. Please see the following file '/DietPi/dietpi/.dietpi-services_include_exclude' for more information: https://github.com/MichaIng/DietPi/issues/1114#issuecomment-411325075
DietPi-Software | A new unified download&install function is implemented, which allows more consistent download and install of software, using /tmp RAMFS as working directory and parallel dependencies installation via G_THREAD.
DietPi-Software | Koel: Installation will now skip webserver, as Koel uses PHP-CLI instead. To not mess with webserver served pages, Koel install directory is moved to "/mnt/dietpi_userdata/koel", for existing installs as well.
-DietPi-Software | Mono: Now installs 'mono-complete' by default, required for Mono based applications (eg: Radarr/Sonarr/Lidarr/Jackett etc)
+DietPi-Software | Mono: Now installs 'mono-complete' by default, required for Mono based applications (e.g. Radarr/Sonarr/Lidarr/Jackett etc)
DietPi-Software | Lidarr: Now available for installation, automatically download music: https://github.com/MichaIng/DietPi/issues/1874
DietPi-Software | Samba Server: Now creates and defaults to the login creds for the 'dietpi' user (previously 'root'). For fresh installations of Samba only: https://github.com/MichaIng/DietPi/issues/1991#issuecomment-410505982
DietPi-Software | Folding@Home: Now available for installation on x86_64 machines. Folding@home is a distributed computing project for disease research that simulates protein folding, computational drug design, and other types of molecular dynamics. As of today, the project is using the idle resources of personal computers owned by volunteers from all over the world. Thousands of people contribute to the success of this project. Thanks to @nnovaes for bringing this to our attention!
@@ -567,7 +641,7 @@ DietPi-Software | WiringPi: Resolved failed installation with RPi.
DietPi-Software | Sonarr: Fixed APT install due to HTTPS error. Reverted to HTTP as of official install instructions. Thanks for report @GulyFMG: https://github.com/MichaIng/DietPi/issues/1953
DietPi-Software | qBitTorrent: Resolved an issue with inability to save webUI settings: https://github.com/MichaIng/DietPi/issues/1957
DietPi-Software | NZBget: Resolved an issue where application would apply incorrect umask to downloaded data, preventing other programs with allowed access, from accessing it: https://github.com/MichaIng/DietPi/issues/1999
-DietPi-Software | Plex: Resolved an issue with ARMv8 installations, where an exisiting install of Mono would cause a failed installation do to package dep issues: https://github.com/MichaIng/DietPi/issues/2006#issuecomment-412653984
+DietPi-Software | Plex: Resolved an issue with ARMv8 installations, where an existing install of Mono would cause a failed installation do to package dep issues: https://github.com/MichaIng/DietPi/issues/2006#issuecomment-412653984
DietPi-Survey | Resolved an issue where a failed connection test would generate an error with UI blocking. As this program is not critical to device operation, the error is now silent without UI blocking: https://github.com/MichaIng/DietPi/issues/1968#issuecomment-408615457
DietPi-Login | Resolved an issue on Jessie systems, that prevented automated "dietpi-software" execution on first login. This was due to Jessie "pgrep" does not support "-i" argument (ignore cases).
General | Resolved other minor issues related to pgrep "-i" argument not being supported on Jessie.
@@ -582,7 +656,7 @@ v6.12
Changes / Improvements / Optimizations:
DietPi-Drive_Manager | Samba/CIFS mounting: Now automatically uses the highest available CIFS version supported on client and server: https://github.com/MichaIng/DietPi/issues/1893#issuecomment-403034799
DietPi-Software | Jackett: Now runs as its own user, and, from the /opt/jackett directory, for new installations only. Many thanks to @userdeveloper98 for contributing this improvement: https://github.com/MichaIng/DietPi/pull/1895
-DietPi-Software | MiniDLNA: Now uses a SystemD service, also updates its library during service start.
+DietPi-Software | MiniDLNA: Now uses a systemd service, also updates its library during service start.
DietPi-Software | JRiver: Removed and no longer available for installation: https://github.com/MichaIng/DietPi/issues/1080#issuecomment-403489246
DietPi-Software | Various titles: Now run under their own system user account, with limited permissions (previously root): https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403298679
DietPi-Software | SABnzbd: Language packs are now installed by default: https://github.com/MichaIng/DietPi/issues/1917#issue-340631943
@@ -591,13 +665,13 @@ DietPi-RAMlog | Service is now disabled when RAMlog mode is not selected: https:
Bug Fixes:
General | Resolved an issue where cron jobs, containing DietPi scripts, failed: https://github.com/MichaIng/DietPi/issues/1923
-General | Resolved an issue on ARM64 + Jessie with APT, due to debian-security removing suppport and packages for those devices. If you experience this issue, and are unable to update DietPi, please see : https://github.com/MichaIng/DietPi/issues/1915
+General | Resolved an issue on ARM64 + Jessie with APT, due to debian-security removing support and packages for those devices. If you experience this issue, and are unable to update DietPi, please see : https://github.com/MichaIng/DietPi/issues/1915
General | Resolved an issue where NFSv3 network drives could not be mounted: https://github.com/MichaIng/DietPi/issues/1898
DietPi-Config | ASUS TB: Resolved loss of WiFi device after a reboot: https://github.com/MichaIng/DietPi/issues/1760
DietPi-Drive_Manager | Resolved an issue where the program could remove a non-empty directory in rare situations.
DietPi-Software | Resolved a potential Mono instability issue with Radarr, Sonarr and Jackett, due to using '--optimize=all --server'. This has now been removed for new installations. Many thanks to @hellfirehd for debugging/testing and @Taloth for dev insights: https://github.com/MichaIng/DietPi/issues/1896
DietPi-Software | Mono: Temp mono files are now cleared from memory once installed, preventing out of memory errors for additional software installs afterwards: https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403856446
-DietPi-Software | Xserver: Resolved rarely occuring uninstall issus by not purging dependencies, but leaving them for autoremove: https://github.com/MichaIng/DietPi/issues/1921
+DietPi-Software | Xserver: Resolved rarely occurring uninstall issues by not purging dependencies, but leaving them for autoremove: https://github.com/MichaIng/DietPi/issues/1921
DietPi-Software | MineOS: Resolved failed installation due to incompatibilities with nodejs v10. v8 is now installed: https://github.com/MichaIng/DietPi/issues/1880
DietPi-Update | Resolved an issue where incorrect version would be displayed, once update was completed. This is due to '| tee' on a function, making var changes local: https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403866204
@@ -630,14 +704,14 @@ General | 'firmware-iwlwifi': Is now a pre-req to WiFi enable. Adds support for
General | "net-tools" commands (ifconfig, netstat, route, ...) were replaced by modern "ip" commands (ip a, ip r, ...) within DietPi scripts and the package therefore removed from DietPi core packages: https://github.com/MichaIng/DietPi/issues/1666
General | Removed unused "/DietPi/config.txt" from non-RPi devices: https://github.com/MichaIng/DietPi/pull/1863
General | CurlFTPFS: Removed from DietPi scripts and is no longer supported. Due to lack of security, and, single digit install count (survey).
-General | Timesync: DietPi will now only check for a sucessful sync once per system boot, and, again hourly/daily if set. This is to prevent excess delay of systemd-timesyncd service, once the time has already been synced.
+General | Timesync: DietPi will now only check for a successful sync once per system boot, and, again hourly/daily if set. This is to prevent excess delay of systemd-timesyncd service, once the time has already been synced.
General | Sparky SBC: Designs patch added for DSD on MPD-5 dac , new Ids added Mytek Manhatten , LH labs 1V5 2V0 ,HD-AVP/AVA IDA-8: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz
DietPi-Backup | Rewritten. Userdata option removed, included by default backup. Added options to edit include/exclude filters in the GUI. Existing backups (v6.9 or less) are no longer supported: https://github.com/MichaIng/DietPi/issues/1851
-DietPi-Config | Soundcards (RPi): Allo Katana, now available for selection. https://github.com/MichaIng/DietPi/issues/1849
-DietPi-Config | IntelGPU Driver: Installation code added: https://github.com/MichaIng/DietPi/issues/1855#issue-333150262
+DietPi-Config | Sound cards (RPi): Allo Katana, now available for selection. https://github.com/MichaIng/DietPi/issues/1849
+DietPi-Config | Intel GPU Driver: Installation code added: https://github.com/MichaIng/DietPi/issues/1855#issue-333150262
DietPi-Config | Networking: You can now view the sent and recieved totals for both network devices. NB: 32bit devices will reset the values after 32bit int limit is reached (roughly 4.3GB~), this is a kernel/arch limitation: https://github.com/MichaIng/DietPi/issues/1666#issuecomment-401546728
DietPi-Drive_Manager | Rewrite and improvements:
- - Now supports ROM devices (eg: DVD). NB: compatibility for DVD/CD devices relies on kernel support. Not all devices will support DVD/CD devices, and/or their filesystem format: https://github.com/MichaIng/DietPi/issues/1858
+ - Now supports ROM devices (e.g. DVD). NB: compatibility for DVD/CD devices relies on kernel support. Not all devices will support DVD/CD devices, and/or their filesystem format: https://github.com/MichaIng/DietPi/issues/1858
- Resize ext4 options added: https://github.com/MichaIng/DietPi/issues/1821
- Support for detecting and formatting non-partitioned drives
- You can now benchmark read/write for all available mounted drives: https://github.com/MichaIng/DietPi/issues/1858
@@ -664,7 +738,7 @@ DietPi-Software | GMrender: Resolved an issue where two systems on the same netw
DietPi-Software | Apache2: Fixed a syntax error that leads to Apache logging to "/error.log" instead of "/var/log/apache2/error.log"
DietPi-Software | Nukkit: Fixed the broken download link on installation. Many thanks to @symbios24 for reporting bug and providing solution: https://github.com/MichaIng/DietPi/issues/1875
DietPi-Software | Linux software: Resolved an issue with NULL entry being displayed: https://github.com/MichaIng/DietPi/pull/1830#issuecomment-401612168
-DietPi-Config | Fixen an issue, where IPv6 could not be disabled on RPi. On current kernel version it is no dedicated kernel module any more and needs to be toggled via "/boot/cmdline.txt".
+DietPi-Config | Fixed an issue, where IPv6 could not be disabled on RPi. On current kernel version it is no dedicated kernel module any more and needs to be toggled via "/boot/cmdline.txt".
AlloGUI v9:
- Changing the root password, no longer breaks web interface: https://github.com/MichaIng/DietPi/issues/1841
@@ -682,38 +756,38 @@ General | During first run of DietPi (and during this patch), you will now be gi
General | Increased verbosity and logging of DietPi boot scripts to assist with debugging: https://github.com/MichaIng/DietPi/issues/1772
General | G_ERROR_HANDLER: Retry mechanic added, allows you to re-run and retry the last command when an error occurs. Also included option to send DietPi a bug report when an issue occurs.
General | NTP removed from DietPi-Config time sync options and DietPi core packages. All time sync modes are now offered via systemd-timesyncd, which is part of every Debian based core system: https://github.com/MichaIng/DietPi/pull/1628
-Generel | DietPi-Set_Core_Environment was removed. DietPi service and system config files are now updates automatically via new update system, other environment setup steps are moved into DietPi-PREP: https://github.com/MichaIng/DietPi/issues/1749
+General | DietPi-Set_Core_Environment was removed. DietPi service and system config files are now updates automatically via new update system, other environment setup steps are moved into DietPi-PREP: https://github.com/MichaIng/DietPi/issues/1749
DietPi-BugReport | Has been revised and improved to remove end user security concerns.
DietPi-Drive_Manager | Swapfile: Added ability to move the swapfile and set size. This replaces the previous option in DietPi-Config.
DietPi-Process_Tool | NoMachine + Webmin: Processes can now be controlled.
DietPi-Services | Webmin: Added and now controlled.
-DietPi-Software | Fail2Ban: Install now uses the systemD backend. No longer requires Rsyslog pre-req. For new installations only.
+DietPi-Software | Fail2Ban: Install now uses the systemd backend. No longer requires Rsyslog pre-req. For new installations only.
DietPi-Software | Search: Feature now available. Find the software you require for install, faster! https://twitter.com/DietPi_/status/1000858660682305536
DietPi-Software | InfluxDB and Grafana now available for installation. Many thanks to @marcobrianza for the install code and documentation guides: https://github.com/MichaIng/DietPi/issues/1784
DietPi-Software | LXDE: Resolved missing icons with 'pcmanfm' under RPi devices: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173
-DietPi-Software | Webmin: Resolved failed installation due to missing package pre-reqs. Upgraded to use a systemD service: https://github.com/MichaIng/DietPi/issues/1741
+DietPi-Software | Webmin: Resolved failed installation due to missing package pre-reqs. Upgraded to use a systemd service: https://github.com/MichaIng/DietPi/issues/1741
DietPi-Software | Removed npm root access error during installs: https://github.com/MichaIng/DietPi/issues/1340#issuecomment-389899081
DietPi-Software | OpenJDK/JRE now installs Java version 8 across all DietPi system. This is for stability across all programs that require it: https://github.com/MichaIng/DietPi/issues/1340#issuecomment-389889264
DietPi-Software | Updated several non-APT software titles for fresh installs and reinstalls: https://github.com/MichaIng/DietPi/pull/1774
DietPi-Software | Transmission: General clean up of install config file. G_CONFIG_INJECT is now used to replace/add our optimized entries. Also cleaned up the service, now runs as forking: https://github.com/MichaIng/DietPi/issues/1754
-DietPi-Software | sabnzbd: Updated to latest version 2.3.4 (for new installations only): https://github.com/MichaIng/DietPi/issues/1340
+DietPi-Software | SABnzbd: Updated to latest version 2.3.4 (for new installations only): https://github.com/MichaIng/DietPi/issues/1340
DietPi-Software | CAVA: Updated to latest version 0.6.1. Enabled for x86_64: https://github.com/MichaIng/DietPi/issues/1340
-DietPi-Software | OctoPrint: libjpeg-dev now installed by default, this is required for additional plugin installations (eg: Astroprintcloud Plugin): https://github.com/MichaIng/DietPi/issues/1800
+DietPi-Software | OctoPrint: libjpeg-dev now installed by default, this is required for additional plugin installations (e.g. Astroprintcloud Plugin): https://github.com/MichaIng/DietPi/issues/1800
DietPi-Software | Xserver: DPMS and all known screen blanking/saving is now disabled by default. To re-enable this feature, remove the following file '/etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf': https://github.com/MichaIng/DietPi/issues/1823
DietPi-Survey | Has been revised and improved to remove end user security concerns.
DietPi-Update | Implemented an automated update system for DietPi files, placed outside of /DietPi, e.g. system configurations and service files. This allows significant reduction of script code and assures consistency across all systems: https://github.com/MichaIng/DietPi/pull/1802
Bug Fixes:
General | Login and globals moved to /etc/bashrc.d/*, due to issues with remote shell and desktop terms under /etc/profile.d/99-dietpi-login.sh: https://github.com/MichaIng/DietPi/issues/1777#issuecomment-390248960
-General | Completely removed root permission requirements from login scirpts and banner. Also users without sudo permissions will see the login banner and will be able to use dietpi-* and G_* functions: https://github.com/MichaIng/DietPi/pull/1790
+General | Completely removed root permission requirements from login scripts and banner. Also users without sudo permissions will see the login banner and will be able to use dietpi-* and G_* functions: https://github.com/MichaIng/DietPi/pull/1790
General | Sparky SBC + USB-DAC unmute fix (v2), now sets volume to max: https://github.com/MichaIng/DietPi/pull/1779
General | UID bit reapplied for Sudo. Reported not applied on current XU4 image: https://github.com/MichaIng/DietPi/issues/794#issuecomment-392335392
DietPi-Config | WiFi HotSpot: Resolved inability to toggle state (enable/disable) and change channel: https://github.com/MichaIng/DietPi/issues/1810#issuecomment-394126835
DietPi-Drive_Manager | Format: Resolved an issue where formatting any drive, would reset the swapfile back to auto size and default location: https://dietpi.com/phpbb/viewtopic.php?f=11&t=3851&p=12864#p12864
DietPi-set_dphys-swapfile | Resolved issues with fallocate on vfat partitions which caused a failure.
-DietPi-Software | SickRage: SystemD service updated to prevent timeouts, allowing the process to fully init. Experienced by some users installs: https://github.com/MichaIng/DietPi/issues/1762
-DietPi-Software | AirSonic: Resolved issues with incorrect memory limit being set during installation: https://github.com/MichaIng/DietPi/issues/1764
-DietPi-Software | AirSonic/SubSonic: Resolved 503 error when accessing web interface: https://github.com/MichaIng/DietPi/issues/1764
+DietPi-Software | SickRage: systemd service updated to prevent timeouts, allowing the process to fully init. Experienced by some users installs: https://github.com/MichaIng/DietPi/issues/1762
+DietPi-Software | Airsonic: Resolved issues with incorrect memory limit being set during installation: https://github.com/MichaIng/DietPi/issues/1764
+DietPi-Software | Airsonic/Subsonic: Resolved 503 error when accessing web interface: https://github.com/MichaIng/DietPi/issues/1764
DietPi-Software | CloudPrint: Resolved an issue where the CUPS web interface would fail to connect: https://github.com/MichaIng/DietPi/issues/1797
DietPi-Software | VNC + LXDE: Resolved error message 'no session for PID x'.:
@@ -726,18 +800,18 @@ Changes / Improvements / Optimizations:
General | All future DietPi images (v6.8 and onwards), now has serial console enabled by default for the 1st run setup. It will be disabled automatically after first run setup to save on resources, unless 'CONFIG_SERIAL_CONSOLE_ENABLE=1' is set in dietpi.txt: https://github.com/MichaIng/DietPi/issues/1759
General | DietPi.com website: Server has been upgraded to Debian Stretch, featuring HTTPS redirect.
General | FBset is no longer a pre-req package for DietPi systems. This will be removed on fresh installations (not existing, to avoid any package conflicts): https://github.com/MichaIng/DietPi/issues/1716
-General | DietPi login script and globals init moved to /etc/profile.d/99-dietpi-login.sh. Ensuring any user on system with sudo permissions can load them. Global commands are also now supported across multiple users, eg: either 'sudo -i G_AGI pacakge' or 'G_SUDO G_AGI package': https://github.com/MichaIng/DietPi/issues/1477
+General | DietPi login script and globals init moved to /etc/profile.d/99-dietpi-login.sh. Ensuring any user on system with sudo permissions can load them. Global commands are also now supported across multiple users, e.g. either 'sudo -i G_AGI package' or 'G_SUDO G_AGI package': https://github.com/MichaIng/DietPi/issues/1477
General | G_WHIP*: Improved scaling detection based on character count and line count. We now also calculate character count per line, to determine if additional lines are required against X. In other words, it should be a more 'snug' fit :) https://github.com/MichaIng/DietPi/issues/1740
DietPi-Automation | 'AUTO_SETUP_RAMLOG_MAXSIZE' added to dietpi.txt. Sets max /var/log tmpfs size during 1st run. Requires v6.8 or higher image.
-DietPi-Config | Native PC > Soundcard: 'firmware-intel-sound' is now installed automatically for Intel based CPUs.
+DietPi-Config | Native PC > Sound card: 'firmware-intel-sound' is now installed automatically for Intel based CPUs.
DietPi-Drive_Manager | Added ability to adjust reserved blocks percentage on ext4 file system: https://github.com/MichaIng/DietPi/issues/1662
DietPi-Drive_Manager | Added ability to check and optionally repair a filesystem. Many thanks to MonZon for the feature request! rootFS and /boot checks will be added in v6.9, currently additional drives are supported by this feature https://github.com/MichaIng/DietPi/issues/1740
DietPi-Drive_Manager | Enabled access for virtual machines: https://github.com/MichaIng/DietPi/issues/1765
DietPi-LetsEncrypt | Lighttpd: SSL configuration upgrade according to Mozillas SSL generator: https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=lighttpd-1.4.35&openssl=1.0.1t&hsts=yes&profile=intermediate
-DietPi-LetsEncrypt | Minor code and error handling improvements, as well increasing transparancy of what the script is currently doing: https://github.com/MichaIng/DietPi/pull/1738
+DietPi-LetsEncrypt | Minor code and error handling improvements, as well increasing transparency of what the script is currently doing: https://github.com/MichaIng/DietPi/pull/1738
DietPi-Process_tool | Rewrite of save file, to allow for stringed entries. The save file will be cleared during the update, to support this feature: https://github.com/MichaIng/DietPi/issues/1750
DietPi-Process_tool | Added Plex Media Server to process tool, however, transcoding will not be affected by this: https://github.com/MichaIng/DietPi/issues/1750#issuecomment-386826317
-DietPi-Set_Hardware | Allo Piano firmware is now installed on demand and will be removed on update, if not chosen as soundcard: https://github.com/MichaIng/DietPi/issues/1656
+DietPi-Set_Hardware | Allo Piano firmware is now installed on demand and will be removed on update, if not chosen as sound card: https://github.com/MichaIng/DietPi/issues/1656
DietPi-Software | AmiBerry (Amiga Emulator): Updated to v2.19, contains bug fixes and improvements: https://github.com/MichaIng/DietPi/issues/1707#issue-314377609
DietPi-Software | Chromium: No longer requires a desktop and can be installed as a lightweight single use program, using dietpi-autostart to run under kiosk mode. Many thanks to @AYapejian! 720p is the default window size, please see '/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh' for full options when running under 'dietpi-autostart' mode: https://github.com/MichaIng/DietPi/issues/1737
DietPi-Software | Readymedia (MiniDLNA): Removed ALSA pre-req as it is not required. Many thanks to @bokiroki: https://github.com/MichaIng/DietPi/issues/1712
@@ -746,7 +820,7 @@ DietPi-Software | Gitea: Updated to latest version (1.4), for new installations
DietPi-Software | PHPBB3: Latest version update (3.2.2), for new installations only.
DietPi-Software | Docker: Enabled for ARMv8 devices: https://github.com/MichaIng/DietPi/issues/1736
PREP | G_HW_MODEL: Added for 'OrangePi PC Plus'. Many thanks to @SuBLiNeR: https://github.com/MichaIng/DietPi/pull/1704
-PREP | Optimized rootfs re-parition and resize. This will reduced the required intial system reboot count by one. Will take affect from official v6.8 DietPi images and onwards.
+PREP | Optimized rootfs re-parition and resize. This will reduced the required inital system reboot count by one. Will take affect from official v6.8 DietPi images and onwards.
Bug Fixes:
General | Remote SCP/Rsync fix when running under 'dietpi' user: https://github.com/MichaIng/DietPi/issues/1703
@@ -779,10 +853,10 @@ DietPi-Backup | Free space check is now run, prior to backup: https://github.com
DietPi-Banner | Added additional credits and support for displaying image creator + pre-image name: https://github.com/MichaIng/DietPi/issues/1621
DietPi-Config | MPEG2/VC1 keys: GPU memory is now increased automatically to 128 (if currently lower), required for this features to function: https://github.com/MichaIng/DietPi/issues/1487
DietPi-Drive_Manager | When formatting EXT4, reserved block size is now set to 0%. This will provide the max available storage for the device (previously 5% was reserved): https://github.com/MichaIng/DietPi/issues/1662#issuecomment-378860605
-DietPi-PREP | Updated to G_WHIP. Added image creator and pre-image name input box (used in banner). All user input questions/prompts at begining of script: https://github.com/MichaIng/DietPi/issues/1621
+DietPi-PREP | Updated to G_WHIP. Added image creator and pre-image name input box (used in banner). All user input questions/prompts at beginning of script: https://github.com/MichaIng/DietPi/issues/1621
DietPi-Software | Samba Server: Reduced the process count of smbd from 4 to 3, by fully disabling printer support. Applied to new installations only: https://github.com/MichaIng/DietPi/issues/1689#issuecomment-379038594
DietPi-Software | Samba Server: Max connections is now limited to 'CPU cores * 2'. This will prevent excess connections and resource usage. Applied to new installations only.
-DietPi-Software | (RPi): 'rpi-bcm2835-ultrahq' is now the default installed soundcard, if no other soundcard has been selected. Previously this was 'rpi-bcm2835', which offered a lower quality audio output when compared to 'rpi-bcm2835-ultrahq'.
+DietPi-Software | (RPi): 'rpi-bcm2835-ultrahq' is now the default installed sound card, if no other sound card has been selected. Previously this was 'rpi-bcm2835', which offered a lower quality audio output when compared to 'rpi-bcm2835-ultrahq'.
DietPi-Sync | Free space check is now run, prior to sync: https://github.com/MichaIng/DietPi/pull/1686
Bug Fixes:
@@ -820,7 +894,7 @@ Bug Fixes:
General | RPi: Resolved issue with updating 'raspberrypi-sys-mods', where the patch would incorrectly apply a new apt mirror, breaking the ability to update: https://github.com/MichaIng/DietPi/issues/1659#issuecomment-377297103
General | firmware-misc-nonfree is now installed by default on all DietPi systems (minus those via PREP with WiFi disabled). Mostly Intel/Nvidia firmware, however, it also contains ralink WiFi firmware: https://github.com/MichaIng/DietPi/issues/1675#issuecomment-377806609
DietPi-Globals | G_RPI_UPDATE: Added APT hold state for "libraspberrypi0", to include all "raspberrypi-firmware" packages, that are overwritten by "rpi-update": https://github.com/MichaIng/DietPi/pull/1657
-DietPi-Process_Tool | Deluge: Is now a SystemD service, which resolves failed process tool apply on forking deluge process: https://github.com/MichaIng/DietPi/issues/1658
+DietPi-Process_Tool | Deluge: Is now a systemd service, which resolves failed process tool apply on forking deluge process: https://github.com/MichaIng/DietPi/issues/1658
-----------------------------------------------------------------------------------------------------------
@@ -836,7 +910,7 @@ DietPi-Environment | Move sudoers adjustments to "/etc/sudoers.d/dietpi": https:
DietPi-Environment | Move sysctl adjustments to "/etc/sysctl.d/dietpi.conf" to assure higher priority than "/etc/sysctl.d/99-sysctl.conf": https://github.com/MichaIng/DietPi/pull/1635
DietPi-Config | Enabled possibility to adjust display resolution for VMs, but max guest display resolution might need to be adjusted within VM software as well: https://github.com/MichaIng/DietPi/issues/1227
DietPi-Config | Advanced options: You can now define the swapfile location: https://github.com/MichaIng/DietPi/issues/1602
-DietPi-Config | Soundcards (RPi): Added option for ApplePi DAC: https://github.com/MichaIng/DietPi/issues/1626
+DietPi-Config | Sound cards (RPi): Added option for ApplePi DAC: https://github.com/MichaIng/DietPi/issues/1626
DietPi-Process_Tool | Added ability to add custom process entries to "/DietPi/dietpi/.dietpi-process_tool_include". Add one process each line with the format :. Check via htop, e.g. "DHCP client:dhclient"
DietPi-Software | NoMachine: Installation updated to 6.0.78 (new installations only): https://github.com/MichaIng/DietPi/issues/1340#issuecomment-372845397
DietPi-Software | Squeezebox server: Updated to systemd native service: https://github.com/MichaIng/DietPi/issues/1613
@@ -850,7 +924,7 @@ General | dphys-swapfile: Has been removed and replace with our own swapfile gen
General | RPi: Resolved issue with gettext error during login due to /etc/profile.d/wifi-country.sh: https://github.com/MichaIng/DietPi/issues/1631
General | RPi: Resolved missing Allo Piano DAC firmware.
General | RPi 3B+: Resolved inability to scan/connect with WiFi: https://github.com/MichaIng/DietPi/issues/1627#issuecomment-375912747
-DietPi-Drive_Manager | Resolved an issue where x-systemd.automount would fail if autofs4 was disabled in kernel/modules (eg: Rock64). x-systemd.automount is now disabled for systems which fail autofs4 detection: https://github.com/MichaIng/DietPi/issues/1607
+DietPi-Drive_Manager | Resolved an issue where x-systemd.automount would fail if autofs4 was disabled in kernel/modules (e.g. Rock64). x-systemd.automount is now disabled for systems which fail autofs4 detection: https://github.com/MichaIng/DietPi/issues/1607
DietPi-Config | Removed 'firmware-ralink' pre-req from WiFi enable. This is a virtual package for 'firmware-misc-nonfree': https://github.com/MichaIng/DietPi/issues/1631
DietPi-Config | RPi: Resolved missing Allo Piano DAC 2.1 entry.
DietPi-Software | PineA64: Resolved issue with failure to run fbturbo driver on Debian Stretch: https://github.com/MichaIng/DietPi/issues/1604
@@ -865,7 +939,7 @@ v6.4 - HotFix
(09/03/18)
Changes / Improvements / Optimizations:
-DietPi-Cron | Added ability to set minutely based cron jobs (eg: every 3 minutes), using /etc/cron.minutely. Many thanks to @d5c0d3 for adding this feature: https://github.com/MichaIng/DietPi/pull/1578
+DietPi-Cron | Added ability to set minutely based cron jobs (e.g. every 3 minutes), using /etc/cron.minutely. Many thanks to @d5c0d3 for adding this feature: https://github.com/MichaIng/DietPi/pull/1578
DietPi-Software | UrBackupServer: Updated to latest version 2.2.8: https://github.com/MichaIng/DietPi/issues/1600
Bug Fixes:
@@ -887,11 +961,11 @@ Native PC BIOS | Image now available: https://dietpi.com/download
NanoPi Neo | Image now available (based on FriendlyARM official image): https://github.com/MichaIng/DietPi/issues/1588
Changes / Improvements / Optimizations:
-General | DietPi now uses its own "dietpi-postboot.service" to initiate dietpi-services, instead of /etc/rc.local. The latter will be reset on update, but in case of manual adjustments, a backup is safed to dietpi_userdata. The initiating "rc-local.service" will stay in place as well, so /etc/rc.local can be used as before: https://github.com/MichaIng/DietPi/issues/1376
+General | DietPi now uses its own "dietpi-postboot.service" to initiate dietpi-services, instead of /etc/rc.local. The latter will be reset on update, but in case of manual adjustments, a backup is saved to dietpi_userdata. The initiating "rc-local.service" will stay in place as well, so /etc/rc.local can be used as before: https://github.com/MichaIng/DietPi/issues/1376
General | Additional getty's (2-6) are now disabled via mask. This reduces resource usage for unneeded screens: https://github.com/MichaIng/DietPi/issues/1541
General | APT: 'Disabled install recommends' is now standard and default across all DietPi images: https://github.com/MichaIng/DietPi/issues/1482#issuecomment-368031044
General | Sparky SBC kernel patches: Pro-Ject-S2 dac DSD native support on sparky, also other few dac ids. Thanks @sudeep.
-General | /tmp tmpfs size is now automatically set to 50% of RAM+SWAP, (previously 50% RAM only). To prevent out of memory errors during certain software installations (eg: Mono), where the swapfile can be used only when needed: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369435049
+General | /tmp tmpfs size is now automatically set to 50% of RAM+SWAP, (previously 50% RAM only). To prevent out of memory errors during certain software installations (e.g. Mono), where the swapfile can be used only when needed: https://github.com/MichaIng/DietPi/issues/1027#issuecomment-369435049
DietPi-Automation | dietpi.txt entries and support added for WPA2 Enterprise (WPA-EAP). Many thanks to @symo for implementing this feature!: https://github.com/MichaIng/DietPi/pull/1547
DietPi-Backup | Once backup is completed, you will be asked if you wish to view the log file, for the full rsync log.
DietPi-Banner | Improved notification when no network is detected: https://github.com/MichaIng/DietPi/issues/1576
@@ -905,15 +979,15 @@ DietPi-Software | Sonarr: Now uses the develop repo branch, inline with our Rada
DietPi-Software | Mono: Raspbian dist is now used for RPi devices: https://github.com/MichaIng/DietPi/issues/1566
DietPi-Software | FFmpeg: Fix backports dependency issues for all Odroids: https://github.com/MichaIng/DietPi/issues/1556
DietPi-Software | Improved UI options during NTPD failure. You will now be given multiple options that will assist in resolving NTPD time sync issues on your network: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370153882
-DietPi-Software | NTPD check will now run after the internet connection test, to prevent unnecessary delay when network is not yet configured:
-DietPi-Software | SubSonic 5: Replaced with Airsonic: https://github.com/MichaIng/DietPi/issues/1585
+DietPi-Software | NTPD check will now run after the internet connection test, to prevent unnecessary delay when network is not yet configured.
+DietPi-Software | Subsonic 5: Replaced with Airsonic: https://github.com/MichaIng/DietPi/issues/1585
DietPi-Software | Aria2: Optimized installation and connection settings based on hardware. Now uses a configuration file '/var/lib/dietpi/dietpi-software/installed/aria2.conf', which will allow users to change aria2 settings permanently. Please note, the aria2-webui does not support saving settings after session shutdown, this is a known limitation with the software, please use the aria2.conf to make changes: https://github.com/MichaIng/DietPi/issues/1575
DietPi-Sync | Once sync is completed, you will be asked if you wish to view the log file, for the full rsync log.
DietPi-Update | G_AGUP/G_AGUG: Now runs prior to our patch system. Ensuring APT is upto date during our updates: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2894&p=11150#p11149
Bug Fixes:
General | G_AGUG: --allow-unauthenticated added for Stretch+ by default (inline with other G_AG commands)
-General | Resolved POSIX issues with dropbear (limitation) and SSH sessions. We now detect for presence of POSIX and set user selected locale during session load: https://github.com/MichaIng/DietPi/issues/1540
+General | Resolved POSIX issues with Dropbear (limitation) and SSH sessions. We now detect for presence of POSIX and set user selected locale during session load: https://github.com/MichaIng/DietPi/issues/1540
General | Resolved multiple issues with failed GNU key management during APT installs from non-standard repos. Dirmngr is now installed on all DietPi systems by default: https://github.com/MichaIng/DietPi/issues/1388
General | Resolved basic APT issues with Meveric's repo and failing dependencies. Debian repo is now used in the first instance: https://github.com/MichaIng/DietPi/pull/1571#issuecomment-369973745
General | DietPi-Globals are now loaded prior to login script. Ensures aliases are functional during exit of 1st run setup: https://github.com/MichaIng/DietPi/issues/1580#issuecomment-370149636
@@ -925,7 +999,7 @@ DietPi-Software | Desktops: USB drive removed from .gtk-bookmarks as no longer u
DietPi-Software | Shairport-Sync: Resolved ARMv6 binary Illegal instruction: https://github.com/MichaIng/DietPi/issues/1548
DietPi-Software | Lighttpd: Resolved an issue with failed enable of php module, due to perl being a undocumented pre-req for 'lighttpd-enable-mod'.
DietPi-Software | MotionEye: Resolved failed installation due to missing build-essential pre-req: https://github.com/MichaIng/DietPi/issues/1564
-DietPi-Software | SubSonic6: Resolved broken URL link. Binary now hosted on dietpi.com: https://github.com/MichaIng/DietPi/issues/1582
+DietPi-Software | Subsonic6: Resolved broken URL link. Binary now hosted on dietpi.com: https://github.com/MichaIng/DietPi/issues/1582
DietPi-Services | Service stop order is now reversed: https://github.com/MichaIng/DietPi/issues/1462#issue-294140894
DietPi-Set_Hardware | Resolved issues with serial consoles not be disabled without dbus installed. Serial consoles are now masked/unmasked (previously disabled): https://github.com/MichaIng/DietPi/issues/1482
DietPi-Update | Resolved an issue where .update_available would exist during reboot, causing banner to display update available incorrectly: https://github.com/MichaIng/DietPi/issues/1535
@@ -936,19 +1010,19 @@ v6.2
(18/02/18)
Changes / Improvements / Optimizations:
-Native PC UEFI | Image now includes options to install to either EMMC (eg: onboard) or SDA (1st HDD) device: https://github.com/MichaIng/DietPi/issues/1171#issuecomment-336522021 | https://dietpi.com/phpbb/viewtopic.php?f=9&t=2809&p=10808#p10808
+Native PC UEFI | Image now includes options to install to either EMMC (e.g. onboard) or SDA (1st HDD) device: https://github.com/MichaIng/DietPi/issues/1171#issuecomment-336522021 | https://dietpi.com/phpbb/viewtopic.php?f=9&t=2809&p=10808#p10808
DietPi-Backup | Rsync: Error control now handled by G_RUN_CMD
DietPi-Config | Locale: Reworked, now only lists UTF-8 items, no longer using dpkg-reconfigure. Our custom set_software script handles all locales ensuring en_GB is always installed, and selected item is applied as system default.
DietPi-Config | Display options > Resolution: Added fkms/kms (OpenGL) modes for RPi 2/3.
-DietPi-Config | Sparky SBC: Added option to select usb-dac-1.1 soundcard, which will enable USB1.1 compatibility.
+DietPi-Config | Sparky SBC: Added option to select usb-dac-1.1 sound card, which will enable USB1.1 compatibility.
DietPi-Config | WiFi: Now supports connecting to hidden WiFi networks, thanks @shahwahed : https://github.com/MichaIng/DietPi/pull/1497
DietPi-LetsEncrypt | On Jessie, changed certificate auto renewal to native certbot renew command, to prevent certificate duplication: https://github.com/MichaIng/DietPi/issues/734
DietPi-LetsEncrypt | On Stretch, added automated Minio certificate renewal. Rerun "dietpi-letsencrypt" on your Stretch system to gain this feature.
DietPi-Process_tool | Reduction of onscreen print. Additional status print will only occur when HIERARCHY is less than 2 and/or an error occurs.
-DietPi-Software | AmiBerry: Massive update to v2.14 and SDL2, new installations only. Currently for RPi's under Stretch only, however, we have plans to impliment for other devices: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=64#p64 https://github.com/MichaIng/DietPi/issues/1410
+DietPi-Software | AmiBerry: Massive update to v2.14 and SDL2, new installations only. Currently for RPi's under Stretch only, however, we have plans to implement for other devices: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=64#p64 https://github.com/MichaIng/DietPi/issues/1410
DietPi-Software | LMS/Squeezebox: Has undergone an install review and re-write. All archs are now supported for Stretch + Jessie: https://github.com/MichaIng/DietPi/issues/1496
DietPi-Software | Pydio: Add PHP module 'intl' on installation, as requested via web ui warning: https://github.com/MichaIng/DietPi/issues/1240
-DietPi-Software | Nginx: To further reduce recource usage, by default 'nginx-light' will be installed now: https://github.com/MichaIng/DietPi/issues/1240
+DietPi-Software | Nginx: To further reduce resource usage, by default 'nginx-light' will be installed now: https://github.com/MichaIng/DietPi/issues/1240
DietPi-Software | PHP: Removed some unused PHP modules from default installation: https://github.com/MichaIng/DietPi/issues/1240
DietPi-Software | Added information regarding DietPi controlling services (stopping them), prior to install/uninstall. Thanks @gpioneer90: https://github.com/MichaIng/DietPi/issues/1484#issuecomment-363802523
DietPi-Software | PiJuice: Available for installation: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=10740#p10740 | https://github.com/MichaIng/DietPi/issues/1488
@@ -962,12 +1036,12 @@ G_AGP | Will now only remove packages which are installed. Non matching items wi
G_DIETPI-NOTIFY | Added initiating program name, to start of line print.
Bug Fixes:
-General | Resolved an issue where externally launched DietPi-Config with target menu, (eg: dietpi-config 8 1) had no effect. EG: fail connection, should go straight to networking submenu.
+General | Resolved an issue where externally launched DietPi-Config with target menu, (e.g. dietpi-config 8 1) had no effect. E.g. fail connection, should go straight to networking submenu.
General | Locales have been reworked and reset: To resolve broken Locales, they have been reset to en_GB.UTF-8.\n\nIf you had a different locale configured on this system, please use dietpi-config at a later date to re-configure. Backups of previous env and locale settings, are created in /mnt/dietpi_userdata/*.bak: https://github.com/MichaIng/DietPi/issues/1430
DietPi-Autostart | Custom: Resolved issue with the dietpi-autostart_custom service failing to run: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2832&p=10862
DietPi-Config | AudioPhonics I-Sabre-K2M: Resolved issue with failed installation. This is now a source build ondemand: https://github.com/MichaIng/DietPi/issues/1437
DietPi-LetsEncrypt | Work around a non-DietPi issue, that prevents certificate renewal via Apache and Nginx on Stretch systems: https://github.com/MichaIng/DietPi/issues/734#issuecomment-361774084
-DietPi-Services | OpenVPN and DNSMASQ (PiHole): Are no longer controlled. This is to prevent unexpected loss of connection during DietPi scripts: https://github.com/MichaIng/DietPi/issues/1501
+DietPi-Services | OpenVPN and DNSMASQ (Pi-hole): Are no longer controlled. This is to prevent unexpected loss of connection during DietPi scripts: https://github.com/MichaIng/DietPi/issues/1501
DietPi-Software | Jessie: Pi-hole is now disabled, pending release of FTL 4.0, which is required to resolve incompatible logging with outdated dnsmasq options under Jessie: https://github.com/MichaIng/DietPi/issues/1524
DietPi-Software | Nginx: Resolved failed installation when IPv6 is disabled, thanks @MichaIng: https://github.com/MichaIng/DietPi/pull/1441
DietPi-Software | OpenVPN Server: Resolved failed installation under Debian Stretch: https://github.com/MichaIng/DietPi/issues/1450
@@ -984,7 +1058,7 @@ DietPi-Software | NodeRed: resolved an issue where the nodered user lacked a hom
Allo Web Interface v6:
Sparky SBC: Resolved an issue where USB1.1 compatibility setting would always be applied, when usb-dac selected.
-Sparky SBC: Added option to select usb-dac-1.1 soundcard, which will enable USB1.1 compatibility.
+Sparky SBC: Added option to select usb-dac-1.1 sound card, which will enable USB1.1 compatibility.
-----------------------------------------------------------------------------------------------------------
@@ -1025,9 +1099,9 @@ General | Swapfile generation is now completed during 1st run of dietpi-software
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/MichaIng/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/MichaIng/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-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/MichaIng/DietPi/issues/1285#issuecomment-352159930
+DietPi-Banner | IP: Will now also list the active network adapter used (e.g. eth0/wlan0)
+DietPi-Config | Dion Audio LOCO V1/V2: Sound cards 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/MichaIng/DietPi/pull/1312
DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/MichaIng/DietPi/issues/1311
@@ -1037,7 +1111,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/MichaIng/DietPi/issues/1298
DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/MichaIng/DietPi/issues/1314#issuecomment-352782055
DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php") on Apache
-DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and creation und uninstall to ownCloud/Nextcloud data directory
+DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and creation on 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/MichaIng/DietPi/issues/1335
@@ -1059,7 +1133,7 @@ DietPi-Software | qBittorrent: Resolved an issue with inability to log into web
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/MichaIng/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/MichaIng/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/MichaIng/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/MichaIng/DietPi/issues/1303
+DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becoming invalid: https://github.com/MichaIng/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 | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/MichaIng/DietPi/pull/1280
DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/MichaIng/DietPi/issues/1310
diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh
index 48aa02c6bc..84f3427e0e 100644
--- a/PREP_SYSTEM_FOR_DIETPI.sh
+++ b/PREP_SYSTEM_FOR_DIETPI.sh
@@ -15,14 +15,14 @@
# - G_DISTRO
# - G_DISTRO_NAME
#
- # The following environment variables can be set to automate the this script (adjust example values to your needs):
+ # The following environment variables can be set to automate this script (adjust example values to your needs):
# - GITOWNER='MichaIng' (optional, defaults to 'MichaIng')
# - GITBRANCH='master' (must be one of 'master', 'beta' or 'dev')
# - IMAGE_CREATOR='Mr. Tux'
# - PREIMAGE_INFO='Some GNU/Linux'
# - HW_MODEL=0 (must match one of the supported IDs below)
# - WIFI_REQUIRED=0 [01]
- # - DISTRO_TARGET=4 [45] (Stretch: 4, Buster: 5)
+ # - DISTRO_TARGET=5 [456] (Stretch: 4, Buster: 5, Bullseye: 6)
#------------------------------------------------------------------------------------------------
# Core globals
@@ -31,10 +31,10 @@
#------------------------------------------------------------------------------------------------
# Critical checks and pre-reqs, with exit, prior to initial run of script
#------------------------------------------------------------------------------------------------
- #Exit path for non-root logins
+ # Exit path for non-root executions
if (( $UID )); then
- echo -e 'ERROR: Root privileges required, please run the script with "sudo"\nIn case install the "sudo" package with root privileges:\n\t# apt-get install -y sudo\n'
+ echo -e '[FAILED] Root privileges required, please run the script with "sudo"\nIn case install the "sudo" package with root privileges:\n\t# apt-get install -y sudo\n'
exit 1
fi
@@ -67,11 +67,11 @@
# Removing conflicting /etc/apt/sources.list.d entries
# - Meveric: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-355759321
[[ -f '/etc/apt/sources.list.d/deb-multimedia.list' ]] && rm /etc/apt/sources.list.d/deb-multimedia.list
- # - OMV: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10594
+ # - OMV: https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772
[[ -f '/etc/apt/sources.list.d/openmediavault.list' ]] && rm /etc/apt/sources.list.d/openmediavault.list
- # Fixing sources.list due to Debian dropped Jessie support: https://github.com/MichaIng/DietPi/issues/2665
- if grep -qi 'jessie' /etc/os-release && ! grep -qi 'raspbian' /etc/os-release; then
+ # Fixing sources.list as Debian dropped Jessie support: https://github.com/MichaIng/DietPi/issues/2665
+ if grep -q 'jessie' /etc/os-release && ! grep -qi 'raspbian' /etc/os-release; then
if [[ $(uname -m) == 'aarch64' ]]; then
@@ -119,7 +119,7 @@
# Setup locale
# - Remove existing settings that could break dpkg-reconfigure locales
> /etc/environment
- [[ -f /etc/default/locale ]] && rm /etc/default/locale
+ [[ -f '/etc/default/locale' ]] && rm /etc/default/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
@@ -134,7 +134,7 @@
fi
# - Update /etc/default/locales with new values (not effective until next load of bash session, eg: logout/in)
- update-locale LC_ALL=en_GB.UTF-8
+ update-locale 'LC_ALL=en_GB.UTF-8'
# - Export locale vars to assure the following whiptail being beautiful
export LC_ALL='en_GB.UTF-8'
@@ -147,24 +147,19 @@
aWHIP_BRANCH=(
- 'master' ': Stable release (recommended)'
+ 'master' ': Stable release branch (recommended)'
'beta' ': Public beta testing branch'
- 'dev' ': Unstable dev branch'
+ 'dev' ': Unstable development branch'
)
- grep -qi 'jessie' /etc/os-release && aWHIP_BRANCH+=( 'jessie-support' 'EOS') #REMOVE v6.24
-
- if GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select the Git branch the installer should use:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then
-
- unset aWHIP_BRANCH
-
- else
+ if ! GITBRANCH=$(whiptail --title "$G_PROGRAM_NAME" --menu 'Please select the Git branch the installer should use:' --default-item 'master' --ok-button 'Ok' --cancel-button 'Exit' --backtitle "$G_PROGRAM_NAME" 12 80 3 "${aWHIP_BRANCH[@]}" 3>&1 1>&2 2>&3); then
echo -e '[ INFO ] No choice detected. Aborting...\n'
exit 0
fi
+ unset aWHIP_BRANCH
fi
@@ -199,7 +194,7 @@
G_GITOWNER=$GITOWNER; unset GITOWNER
G_GITBRANCH=$GITBRANCH; unset GITBRANCH
- # - Detect the the Debian version of this operating system.
+ # - Detect the Debian version of this operating system.
if grep -q 'jessie' /etc/os-release; then
G_DISTRO=3
@@ -215,6 +210,11 @@
G_DISTRO=5
G_DISTRO_NAME='buster'
+ elif grep -q 'bullseye' /etc/os-release; then
+
+ G_DISTRO=6
+ G_DISTRO_NAME='bullseye'
+
else
G_DIETPI-NOTIFY 1 'Unknown or unsupported distribution version. Aborting...\n'
@@ -222,7 +222,7 @@
fi
- # - Detect the the hardware architecture of this operating system.
+ # - Detect the hardware architecture of this operating system.
G_HW_ARCH_DESCRIPTION=$(uname -m)
if [[ $G_HW_ARCH_DESCRIPTION == 'armv6l' ]]; then
@@ -259,7 +259,7 @@
((SETUP_STEP++))
G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------'
#------------------------------------------------------------------------------------------------
- if [[ -d /DietPi/dietpi || -d /boot/dietpi ]]; then
+ if [[ -d '/DietPi/dietpi' || -d '/boot/dietpi' ]]; then
G_DIETPI-NOTIFY 2 'DietPi system found, removing the old files and stopping services. (pre-prep)'
@@ -273,7 +273,7 @@
do
[[ -f $i ]] || continue
- systemctl disable ${i##*/}
+ systemctl disable --now ${i##*/}
rm $i
done
@@ -344,7 +344,6 @@
fi
done
-
unset aDISALLOWED_NAMES
if (( $DISALLOWED_NAME )); then
@@ -394,20 +393,19 @@
'' '●─ Other '
'22' ': Generic device (unknown to DietPi)'
'' '●─ SBC─(Core devices, with GPU support) '
- '52' ': ASUS Tinker Board'
- '10' ': Odroid C1'
'12' ': Odroid C2'
'11' ': Odroid XU3/XU4/HC1/HC2'
'44' ': Pinebook 1080p'
'0' ': Raspberry Pi (All models)'
- # '1' ': Raspberry Pi 1/Zero (512mb)'
- # '2' ': Raspberry Pi 2'
- # '3' ': Raspberry Pi 3/3+'
- # '4' ': Raspberry Pi 4'
+ #'1' ': Raspberry Pi 1/Zero (512mb)'
+ #'2' ': Raspberry Pi 2'
+ #'3' ': Raspberry Pi 3/3+'
+ #'4' ': Raspberry Pi 4'
'' '●─ PC '
'21' ': x86_64 Native PC'
- '20' ': x86_64 VMware/VirtualBox'
+ '20' ': x86_64 Virtual Machine'
'' '●─ SBC─(Limited support devices, no GPU support) '
+ '52' ': ASUS Tinker Board'
'53' ': BananaPi (sinovoip)'
'51' ': BananaPi Pro (Lemaker)'
'50' ': BananaPi M2+ (sinovoip)'
@@ -423,6 +421,7 @@
'62' ': NanoPi M3/T3/F3'
'68' ': NanoPC T4'
'67' ': NanoPi K1 Plus'
+ '10' ': Odroid C1'
'14' ': Odroid N1'
'15' ': Odroid N2'
'13' ': Odroid U3'
@@ -496,7 +495,6 @@
(( $G_HW_MODEL == 20 )) && G_WHIP_DEFAULT_ITEM=0
if G_WHIP_MENU 'Please select an option:'; then
-
WIFI_REQUIRED=$G_WHIP_RETURNED_VALUE
else
@@ -513,9 +511,9 @@
# Distro Selection
DISTRO_LIST_ARRAY=(
- '3' ': jessie-support' #REMOVE v6.24
- '4' ': Stretch (current stable release, recommended)'
- '5' ': Buster (testing only, not officially supported)'
+ '4' ': Stretch (oldstable, if SBC firmware is not yet Buster-compatible)'
+ '5' ': Buster (current stable release, recommended)'
+ '6' ': Bullseye (testing, if you want to live on bleeding edge)'
)
@@ -538,7 +536,6 @@
fi
done
-
unset DISTRO_LIST_ARRAY
if (( ! ${#G_WHIP_MENU_ARRAY[@]} )); then
@@ -564,26 +561,22 @@
G_WHIP_DEFAULT_ITEM=${G_WHIP_MENU_ARRAY[0]} # Downgrades disabled, so first item matches current/lowest supported distro version
G_WHIP_BUTTON_CANCEL_TEXT='Exit'
- G_WHIP_MENU "Please select a distro version 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"
- if (( $? )); then
+ if G_WHIP_MENU "Please select a Debian version to install on this system.\n
+Currently installed: $G_DISTRO $G_DISTRO_NAME"; then
- G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n'
- exit 0
+ DISTRO_TARGET=$G_WHIP_RETURNED_VALUE
+ break
else
- DISTRO_TARGET=$G_WHIP_RETURNED_VALUE
- break
+ G_DIETPI-NOTIFY 1 'No choice detected. Aborting...\n'
+ exit 0
fi
done
- if (( $DISTRO_TARGET == 3 )); then #REMOVE v6.24
-
- DISTRO_TARGET_NAME='jessie'
-
- elif (( $DISTRO_TARGET == 4 )); then
+ if (( $DISTRO_TARGET == 4 )); then
DISTRO_TARGET_NAME='stretch'
@@ -591,6 +584,10 @@
DISTRO_TARGET_NAME='buster'
+ elif (( $DISTRO_TARGET == 6 )); then
+
+ DISTRO_TARGET_NAME='bullseye'
+
else
G_DIETPI-NOTIFY 1 'Invalid choice detected. Aborting...\n'
@@ -616,11 +613,11 @@
l_message='Extracting DietPi sourcecode' G_RUN_CMD unzip package.zip
rm package.zip
- [[ -d /boot ]] || l_message='Creating /boot' G_RUN_CMD mkdir -p /boot
+ [[ -d '/boot' ]] || l_message='Creating /boot' G_RUN_CMD mkdir -p /boot
G_DIETPI-NOTIFY 2 'Moving kernel and boot configuration to /boot'
- # - HW specific config.txt, boot.ini uEnv.txt
+ # HW specific config.txt, boot.ini uEnv.txt
if (( $G_HW_MODEL < 10 )); then
G_RUN_CMD mv "DietPi-$G_GITBRANCH/config.txt" /boot/
@@ -639,12 +636,12 @@
G_RUN_CMD mv "DietPi-$G_GITBRANCH/README.md" /boot/dietpi-README.md
G_RUN_CMD mv "DietPi-$G_GITBRANCH/CHANGELOG.txt" /boot/dietpi-CHANGELOG.txt
- # - Reading version string for later use
+ # Reading version string for later use
G_DIETPI_VERSION_CORE=$(sed -n 1p "DietPi-$G_GITBRANCH/dietpi/server_version-6")
G_DIETPI_VERSION_SUB=$(sed -n 2p "DietPi-$G_GITBRANCH/dietpi/server_version-6")
G_DIETPI_VERSION_RC=$(sed -n 3p "DietPi-$G_GITBRANCH/dietpi/server_version-6")
- # - Remove server_version* / (pre-)patch_file (downloads fresh from dietpi-update)
+ # Remove server_version* / (pre-)patch_file (downloads fresh from dietpi-update)
rm "DietPi-$G_GITBRANCH/dietpi/server_version"*
rm "DietPi-$G_GITBRANCH/dietpi/pre-patch_file"
rm "DietPi-$G_GITBRANCH/dietpi/patch_file"
@@ -657,7 +654,7 @@
G_RUN_CMD systemctl daemon-reload
G_RUN_CMD systemctl enable dietpi-ramdisk
- # - Mount tmpfs
+ # Mount tmpfs
G_RUN_CMD mkdir -p /DietPi
G_RUN_CMD mount -t tmpfs -o size=10m tmpfs /DietPi
l_message='Starting DietPi-RAMdisk' G_RUN_CMD systemctl start dietpi-ramdisk
@@ -672,26 +669,26 @@
G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET"
- # - We need to forward $DISTRO_TARGET* to dietpi-set_software, as well as $G_HW_MODEL for Debian vs Raspbian decision.
+ # We need to forward $DISTRO_TARGET* to dietpi-set_software, as well as $G_HW_MODEL for Debian vs Raspbian decision.
G_DISTRO=$DISTRO_TARGET G_DISTRO_NAME=$DISTRO_TARGET_NAME G_HW_MODEL=$G_HW_MODEL G_RUN_CMD /DietPi/dietpi/func/dietpi-set_software apt-mirror 'default'
- # - Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302
+ # Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302
sed -Ei 's@https?://oph\.mdrjr\.net@http://fuzon.co.uk@' /etc/apt/sources.list.d/meveric* &> /dev/null
- # - (Re)create DietPi logs dir, used by G_AGx
+ # (Re)create DietPi logs dir, used by G_AGx
G_RUN_CMD mkdir -p /var/tmp/dietpi/logs
G_AGUP
- # - @MichaIng https://github.com/MichaIng/DietPi/pull/1266/files
+ # @MichaIng https://github.com/MichaIng/DietPi/pull/1266/files
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/MichaIng/DietPi/pull/1266/files
+ # @MichaIng https://github.com/MichaIng/DietPi/pull/1266/files
G_DIETPI-NOTIFY 2 'Disable automatic recommends/suggests install and allow them to be autoremoved:'
- # Remove any existing APT recommends settings
+ # - Remove any existing APT recommends settings
rm -f /etc/apt/apt.conf.d/*recommends*
G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-norecommends'
@@ -704,8 +701,10 @@ _EOF_
G_ERROR_HANDLER_EXITCODE=$?
G_ERROR_HANDLER
- G_DIETPI-NOTIFY 2 'Preserve modified config files on APT update:'
+ G_DIETPI-NOTIFY 2 'Disable package state translation downloads'
+ echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/98-dietpi-no_translations
+ G_DIETPI-NOTIFY 2 'Preserve modified config files on APT update:'
G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-forceconf'
cat << _EOF_ > $G_ERROR_HANDLER_COMMAND
Dpkg::options {
@@ -716,7 +715,7 @@ _EOF_
G_ERROR_HANDLER_EXITCODE=$?
G_ERROR_HANDLER
- # - DietPi list of minimal required packages, which must be installed:
+ # DietPi list of minimal required packages, which must be installed:
aPACKAGES_REQUIRED_INSTALL=(
'apt-transport-https' # Allows HTTPS sources for ATP
@@ -730,11 +729,9 @@ _EOF_
'curl' # Web address testing, downloading, uploading etc.
'debconf' # APT package pre-configuration, e.g. "debconf-set-selections" for non-interactive install
'dirmngr' # GNU key management required for some APT installs via additional repos
- '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
'gnupg' # apt-key add
- 'haveged' # Entropy daemon: https://github.com/MichaIng/DietPi/issues/2806
'htop' # System monitor
'iputils-ping' # "ping" command
'isc-dhcp-client' # DHCP client
@@ -742,7 +739,7 @@ _EOF_
'locales' # Support locales, necessary for DietPi scripts, as we use en_GB.UTF8 as default language
'nano' # Simple text editor
'p7zip' # .7z wrapper
- 'parted' # Drive partitioning, required by DietPi-Boot + DietPi-Drive_Manager
+ 'parted' # partprobe + drive partitioning, required by DietPi-Drive_Manager
'procps' # "kill", "ps", "pgrep", "sysctl", used by several DietPi scripts
'psmisc' # "killall", used by several DietPi scripts
'resolvconf' # Network nameserver handler + depandant for "ifupdown" (network interface handler) => "iproute2" ("ip" command)
@@ -757,19 +754,32 @@ _EOF_
)
- # - G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273
+ # G_DISTRO specific
+ # - Dropbear: DietPi default SSH-Client
+ # On Buster-, "dropbear" fulls in "dropbear-initramfs", which we don't need
+ if (( $G_DISTRO > 5 )); then
+
+ aPACKAGES_REQUIRED_INSTALL+=('dropbear')
+
+ else
+
+ aPACKAGES_REQUIRED_INSTALL+=('dropbear-run')
+
+ fi
+
+ # G_HW_MODEL specific required repo key packages: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-358301273
if (( $G_HW_MODEL > 9 )); then
- G_AGI debian-archive-keyring
- aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools') # RAM file system initialization, required for generic boot loader, but not required/used by RPi bootloader
+ aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools') # RAM file system initialisation, required for generic bootloader, but not required/used by RPi bootloader
+ aPACKAGES_REQUIRED_INSTALL+=('haveged') # Entropy daemon: https://github.com/MichaIng/DietPi/issues/2806
else
- G_AGI raspbian-archive-keyring
+ aPACKAGES_REQUIRED_INSTALL+=('rng-tools') # Entropy daemon: Alternative, that does not work on all devices, but is proven to work on RPi, is default on Raspbian and uses less RAM on idle.
fi
- # - WiFi related packages
+ # WiFi related
if (( $WIFI_REQUIRED )); then
aPACKAGES_REQUIRED_INSTALL+=('crda') # WiFi related
@@ -780,7 +790,7 @@ _EOF_
fi
- # - G_HW_MODEL specific required packages:
+ # G_HW_MODEL specific
if (( $G_HW_MODEL != 20 )); then
aPACKAGES_REQUIRED_INSTALL+=('dosfstools') # DietPi-Drive_Manager + fat (boot) drive file system check and creation tools
@@ -788,21 +798,21 @@ _EOF_
fi
- # - Kernel required packages
- # - G_HW_ARCH specific required Kernel packages
- # As these are kernel, or bootloader packages, we need to install them directly to allow autoremove of in case older kernel packages:
- # https://github.com/MichaIng/DietPi/issues/1285#issuecomment-354602594
-
+ # Kernel/bootloader/firmware
+ # - We need to install those directly to allow G_AGA() autoremove possible older packages later: https://github.com/MichaIng/DietPi/issues/1285#issuecomment-354602594
+ # - G_HW_ARCH specific
# x86_64
if (( $G_HW_ARCH == 10 )); then
G_AGI linux-image-amd64 os-prober
# Grub EFI
- if dpkg-query -s 'grub-efi-amd64' &> /dev/null ||
- [[ -d '/boot/efi' ]]; then
+ if dpkg-query -s 'grub-efi-amd64' &> /dev/null || [[ -d '/boot/efi' ]]; then
- G_AGI grub-efi-amd64
+ local efi_packages='grub-efi-amd64'
+ # On Buster+ enable secure boot compatibility: https://packages.debian.org/buster/grub-efi-amd64-signed
+ (( $DISTRO_TARGET > 4 )) && efi_packages+='grub-efi-amd64-signed shim-signed'
+ G_AGI $efi_packages
# Grub BIOS
else
@@ -813,18 +823,17 @@ _EOF_
# - G_HW_MODEL specific required Kernel packages
# ARMbian grab currently installed packages
- elif dpkg --get-selections | grep -qi armbian; then
+ elif dpkg --get-selections | grep -qi 'armbian'; then
systemctl stop armbian-*
local apackages=(
- "armbian-tools-$DISTRO_TARGET_NAME"
'linux-dtb-'
'linux-u-'
'linux-image-'
- "linux-$DISTRO_TARGET_NAME"
- 'sunxi'
+ "linux-$DISTRO_TARGET_NAME-"
+ 'sunxi-tools'
)
@@ -834,13 +843,9 @@ _EOF_
while read -r line
do
- if [[ $line ]]; then
-
- aPACKAGES_REQUIRED_INSTALL+=("$line")
- apt-mark hold $line
- G_DIETPI-NOTIFY 2 "PKG detected and set on hold: $line"
-
- fi
+ aPACKAGES_REQUIRED_INSTALL+=("$line")
+ apt-mark hold $line
+ G_DIETPI-NOTIFY 2 "PKG detected and set on hold: $line"
done <<< "$(dpkg --get-selections | mawk -v pat="^$i" '$0~pat {print $1}')"
@@ -862,7 +867,6 @@ _EOF_
elif (( $G_HW_MODEL == 14 )); then
G_AGI linux-image-arm64-odroid-n1
- #G_AGI libdrm-rockchip1 # Not currently on meveric's repo
# Odroid C2
elif (( $G_HW_MODEL == 12 )); then
@@ -882,7 +886,7 @@ _EOF_
# - Auto detect kernel package incl. ARMbian/others DTB
else
- AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | grep -E '^linux-(image|dtb)' | mawk '{print $1}')
+ AUTO_DETECT_KERN_PKG=$(dpkg --get-selections | mawk '/^linux-(image|dtb)/ {print $1}')
if [[ $AUTO_DETECT_KERN_PKG ]]; then
G_AGI $AUTO_DETECT_KERN_PKG
@@ -905,17 +909,31 @@ _EOF_
# Usually no firmware should be necessary for VMs. If user manually passes though some USB device, user might need to install the firmware then.
if (( $G_HW_MODEL != 20 )); then
- aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # Eth/WiFi/BT dongle firmware
- aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-nonfree') # Various drivers for generic devices
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # Realtek Eth+WiFi+BT dongle firmware
+ if (( $G_HW_ARCH == 10 )); then
+
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-linux') # Misc free+nonfree firmware
+
+ else
+
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-free') # Misc free firmware
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') # Misc nonfree firmware + Ralink WiFi
+
+ fi
fi
if (( $WIFI_REQUIRED )); then
- aPACKAGES_REQUIRED_INSTALL+=('firmware-atheros') # WiFi dongle firmware
- aPACKAGES_REQUIRED_INSTALL+=('firmware-brcm80211') # WiFi dongle firmware
- aPACKAGES_REQUIRED_INSTALL+=('firmware-iwlwifi') # Intel WiFi dongle/PCI-e firwmare
- aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') # Intel/Nvidia/WiFi (Ralink) dongle firmware
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-atheros') # Qualcomm/Atheros WiFi+BT dongle firmware
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-brcm80211') # Breadcom WiFi dongle firmware
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-iwlwifi') # Intel WiFi dongle+PCIe firmware
+ if (( $G_HW_MODEL == 20 )); then
+
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-realtek') # Realtek Eth+WiFi+BT dongle firmware
+ aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') # Misc nonfree firmware + Ralink WiFi
+
+ fi
fi
@@ -933,6 +951,8 @@ _EOF_
# - dhcpcd5: https://github.com/MichaIng/DietPi/issues/1560#issuecomment-370136642
# - mountall: https://github.com/MichaIng/DietPi/issues/2613
G_AGP dbus dhcpcd5 mountall
+ # Remove any autoremove prevention
+ rm -f /etc/apt/apt.conf.d/01autoremove*
G_AGA
#------------------------------------------------------------------------------------------------
@@ -948,18 +968,15 @@ _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
+ unset DISTRO_TARGET DISTRO_TARGET_NAME
G_DIETPI-NOTIFY 2 'Installing core DietPi pre-req APT packages'
G_AGI ${aPACKAGES_REQUIRED_INSTALL[@]}
-
unset aPACKAGES_REQUIRED_INSTALL
G_AGA
- # Reenable HTTPS for deb.debian.org, since system was dist-upgraded to Stretch+
- (( $G_HW_MODEL > 9 )) && sed -i 's/http:/https:/g' /etc/apt/sources.list
-
#------------------------------------------------------------------------------------------------
echo ''
G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------'
@@ -968,15 +985,23 @@ _EOF_
G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------'
#------------------------------------------------------------------------------------------------
- G_DIETPI-NOTIFY 2 'Deleting list of known users, not required by DietPi'
+ G_DIETPI-NOTIFY 2 'Deleting list of known users and groups, not required by DietPi'
getent passwd pi &> /dev/null && userdel -f pi
- getent passwd test &> /dev/null && userdel -f test #@fourdee
+ getent passwd test &> /dev/null && userdel -f test # @fourdee
getent passwd odroid &> /dev/null && userdel -f odroid
getent passwd rock64 &> /dev/null && userdel -f rock64
- getent passwd linaro &> /dev/null && userdel -f linaro #ASUS TB
- getent passwd dietpi &> /dev/null && userdel -f dietpi #recreated below
- getent passwd debian &> /dev/null && userdel -f debian #BBB
+ getent passwd linaro &> /dev/null && userdel -f linaro # ASUS TB
+ getent passwd dietpi &> /dev/null && userdel -f dietpi # recreated below
+ getent passwd debian &> /dev/null && userdel -f debian # BBB
+ getent passwd openmediavault-webgui &> /dev/null && userdel -f openmediavault-webgui # OMV (NanoPi NEO2)
+ getent passwd admin &> /dev/null && userdel -f admin # OMV (NanoPi NEO2)
+ getent passwd fa &> /dev/null && userdel -f fa # OMV (NanoPi NEO2)
+ getent passwd colord &> /dev/null && userdel -f colord # OMV (NanoPi NEO2)
+ getent passwd saned &> /dev/null && userdel -f saned # OMV (NanoPi NEO2)
+ getent group openmediavault-config &> /dev/null && groupdel openmediavault-config # OMV (NanoPi NEO2)
+ getent group openmediavault-engined &> /dev/null && groupdel openmediavault-engined # OMV (NanoPi NEO2)
+ getent group openmediavault-webgui &> /dev/null && groupdel openmediavault-webgui # OMV (NanoPi NEO2)
G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi'
@@ -1028,12 +1053,9 @@ _EOF_
for j in /etc/init.d/$i /{etc,lib,usr/lib}/systemd/system/$i.service{,.d}
do
- if [[ -e $j ]]; then
-
- [[ -f $j ]] && systemctl disable --now ${j##*/}
- rm -R $j
-
- fi
+ [[ -e $j ]] || continue
+ [[ -f $j ]] && systemctl disable --now ${j##*/}
+ rm -R $j
done
@@ -1047,7 +1069,7 @@ _EOF_
[[ -d '/usr/lib/armbian' ]] && rm -R /usr/lib/armbian
[[ -f '/usr/local/sbin/log2ram' ]] && rm /usr/local/sbin/log2ram
[[ -d '/usr/share/armbian' ]] && rm -R /usr/share/armbian
- #rm -f /etc/armbian* armbian-release required for kernel package update success.
+ #rm -f /etc/armbian* armbian-release required for kernel package update (initramfs postinst)
rm -f /etc/apt/apt.conf.d/*armbian*
rm -f /etc/cron.*/armbian*
rm -f /etc/default/armbian*
@@ -1057,6 +1079,11 @@ _EOF_
umount /var/log.hdd 2> /dev/null
[[ -d '/var/log.hdd' ]] && rm -R /var/log.hdd
+ # - OMV: https://github.com/MichaIng/DietPi/issues/2994
+ [[ -d '/etc/openmediavault' ]] && rm -R /etc/openmediavault
+ rm -f /etc/cron.*/openmediavault*
+ rm -f /usr/sbin/omv-*
+
# - Meveric specific
[[ -f '/usr/local/sbin/setup-odroid' ]] && rm /usr/local/sbin/setup-odroid
@@ -1087,16 +1114,13 @@ _EOF_
ln -sf /etc/profile.d/bash_completion.sh /etc/bashrc.d/dietpi-bash_completion.sh
#-----------------------------------------------------------------------------------
- #Create_DietPi_User
-
+ # DietPi user
l_message='Creating DietPi User Account' G_RUN_CMD /DietPi/dietpi/func/dietpi-set_software useradd dietpi
#-----------------------------------------------------------------------------------
- #UID bit for sudo: https://github.com/MichaIng/DietPi/issues/794
-
- G_DIETPI-NOTIFY 2 'Configuring Sudo UID bit'
-
- chmod 4755 $(which sudo)
+ # UID bit for sudo: https://github.com/MichaIng/DietPi/issues/794
+ G_DIETPI-NOTIFY 2 'Configuring sudo UID bit'
+ chmod 4755 $(command -v sudo)
#-----------------------------------------------------------------------------------
# Dirs
@@ -1188,15 +1212,18 @@ _EOF_
# MISC
G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock'
-
for i in apt-daily{,-upgrade}.{service,timer}
do
- systemctl disable --now $i &> /dev/null
- systemctl mask $i &> /dev/null
+ systemctl disable --now $i 2> /dev/null
+ systemctl mask $i 2> /dev/null
done
+ G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed'
+ systemctl disable --now e2scrub_all.timer 2> /dev/null
+ systemctl disable --now e2scrub_reap 2> /dev/null
+
local info_use_drive_manager='Can be installed and setup by DietPi-Drive_Manager.\nSimply run "dietpi-drive_manager" and select "Add network drive".'
echo -e "Samba client: $info_use_drive_manager" > /mnt/samba/readme.txt
echo -e "NFS client: $info_use_drive_manager" > /mnt/nfs_client/readme.txt
@@ -1210,18 +1237,16 @@ _EOF_
cd /tmp/$G_PROGRAM_NAME
G_DIETPI-NOTIFY 2 'Deleting all log files /var/log'
-
/DietPi/dietpi/func/dietpi-logclear 2 &> /dev/null # As this will report missing vars, however, its fine, does not break functionality.
l_message='Starting DietPi-RAMlog service' G_RUN_CMD systemctl start dietpi-ramlog
- G_DIETPI-NOTIFY 2 'Updating DietPi HW_INFO'
-
+ G_DIETPI-NOTIFY 2 'Updating /DietPi/dietpi/.hw_model'
/DietPi/dietpi/func/dietpi-obtain_hw_model
G_DIETPI-NOTIFY 2 'Configuring network interfaces:'
- [[ -f '/etc/network/interfaces' ]] && rm -R /etc/network/interfaces # ARMbian symlink for bulky network-manager
+ [[ -L '/etc/network/interfaces' ]] && rm /etc/network/interfaces # ARMbian symlink for bulky network-manager
G_ERROR_HANDLER_COMMAND='/etc/network/interfaces'
cat << _EOF_ > $G_ERROR_HANDLER_COMMAND
@@ -1232,7 +1257,7 @@ _EOF_
# Drop-in configs
source interfaces.d/*
-# Local
+# Loopback
auto lo
iface lo inet loopback
@@ -1257,22 +1282,22 @@ _EOF_
G_ERROR_HANDLER_EXITCODE=$?
G_ERROR_HANDLER
- # - Remove all predefined eth*/wlan* adapter rules
+ # Remove all predefined eth*/wlan* adapter rules
rm -f /etc/udev/rules.d/70-persist*nt-net.rules
- # Add pre-up lines for wifi on OrangePi Zero
+ # Add pre-up lines for WiFi on OrangePi Zero
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
- # ASUS TB WiFi: https://github.com/MichaIng/DietPi/issues/1760
+ # ASUS TB WiFi: https://github.com/MichaIng/DietPi/issues/1760
elif (( $G_HW_MODEL == 52 )); then
G_CONFIG_INJECT '8723bs' '8723bs' /etc/modules
fi
- # Fix rare WiFi interface start issue: https://github.com/MichaIng/DietPi/issues/2074
+ # Fix wireless-tools bug on Stretch: https://bugs.debian.org/908886
[[ -f '/etc/network/if-pre-up.d/wireless-tools' ]] && sed -i '\|^[[:blank:]]ifconfig "$IFACE" up$|c\\t/sbin/ip link set dev "$IFACE" up' /etc/network/if-pre-up.d/wireless-tools
G_DIETPI-NOTIFY 2 'Tweaking DHCP timeout:'
@@ -1331,43 +1356,45 @@ _EOF_
G_ERROR_HANDLER
G_DIETPI-NOTIFY 2 'Configuring fake-hwclock:'
-
systemctl stop fake-hwclock
-
- # - Allow times in the past
+ # Allow times in the past
G_CONFIG_INJECT 'FORCE=' 'FORCE=force' /etc/default/fake-hwclock
-
systemctl restart fake-hwclock # Failsafe, apply now if date is way far back...
- G_DIETPI-NOTIFY 2 'Configuring enable serial console:'
+ G_DIETPI-NOTIFY 2 'Configuring serial login consoles:'
- /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable
+ # On virtual machines, serial consoles are not required
+ if (( $G_HW_MODEL == 20 )); then
- # - RPi: Depending on current config.txt and model, no all serial devices are available, so enable console manually for both:
- if (( $G_HW_MODEL < 10 )); then
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
+
+ else
+
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable
+ # On RPi the primary serial console depends on model, use "serial0" which links to the primary console, converts to correct device on first boot
+ if (( $G_HW_MODEL < 10 )); then
+
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable ttyAMA0
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable ttyS0
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole enable serial0
- systemctl enable serial-getty@ttyAMA0
- systemctl enable serial-getty@ttyS0
+ fi
fi
G_DIETPI-NOTIFY 2 'Reducing getty count and resource usage:'
-
systemctl mask getty-static
# - logind features disabled by default. Usually not needed and all features besides auto getty creation are not available without libpam-systemd package.
# - It will be unmasked/enabled, automatically if libpam-systemd got installed during dietpi-software install, usually with desktops.
- systemctl stop systemd-logind
- systemctl disable systemd-logind &> /dev/null
+ systemctl disable --now systemd-logind &> /dev/null
systemctl mask systemd-logind
G_DIETPI-NOTIFY 2 'Configuring regional settings (TZdata):'
-
rm -Rf /etc/{localtime,timezone}
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
G_RUN_CMD dpkg-reconfigure -f noninteractive tzdata
G_DIETPI-NOTIFY 2 'Configuring regional settings (Keyboard):'
-
dpkg-reconfigure -f noninteractive keyboard-configuration # Keyboard must be plugged in for this to work!
#G_DIETPI-NOTIFY 2 "Configuring regional settings (Locale):" # Runs at start of script
@@ -1427,7 +1454,7 @@ _EOF_
echo 'blacklist bmp085' > /etc/modprobe.d/bmp085.conf
- # - Sparky SBC ONLY:
+ # - Sparky SBC:
elif (( $G_HW_MODEL == 70 )); then
# Install latest kernel
@@ -1476,7 +1503,7 @@ _EOF_
# Use performance gov for stability.
G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' 'CONFIG_CPU_GOVERNOR=performance' /DietPi/dietpi.txt
- # - RPI:
+ # - RPi:
elif (( $G_HW_MODEL < 10 )); then
# - Scroll lock fix for RPi by Midwan: https://github.com/MichaIng/DietPi/issues/474#issuecomment-243215674
@@ -1484,7 +1511,10 @@ _EOF_
ACTION=="add", SUBSYSTEM=="leds", ENV{DEVPATH}=="*/input*::scrolllock", ATTR{trigger}="kbd-scrollock"
_EOF_
- # - PINE64 (and possibily others): Cursor fix for FB
+ # - Disable RPi camera to add modules blacklist
+ /DietPi/dietpi/func/dietpi-set_hardware rpi-camera disable
+
+ # - Pine A64 (and possibily others): Cursor fix for FB
elif (( $G_HW_MODEL == 40 )); then
mkdir -p /etc/bashrc.d
@@ -1501,23 +1531,34 @@ _EOF_
# - Ensure WiFi module pre-exists
G_CONFIG_INJECT '8723bs' '8723bs' /etc/modules
- # - Rock64, remove HW accell config, as its not currently functional: https://github.com/MichaIng/DietPi/issues/2086
- elif (( $G_HW_MODEL == 43 )); then
+ # - Rock(Pro)64: Apply workaround for kernel-related Ethernet issues: https://github.com/MichaIng/DietPi/issues/3066
+ elif [[ $G_HW_MODEL == 4[23] ]]; then
+
+ local identifier='ff540000'
+ (( $G_HW_MODEL == 43 )) && identifier='fe300000'
- [[ -f '/etc/X11/xorg.conf.d/20-armsoc.conf' ]] && rm /etc/X11/xorg.conf.d/20-armsoc.conf
+ if [[ -f '/boot/boot.cmd' ]] && ! grep -q "$identifier" /boot/boot.cmd; then
- # - Odroids FFMPEG fix. Prefer debian.org over Meveric for backports: https://github.com/MichaIng/DietPi/issues/1273 + https://github.com/MichaIng/DietPi/issues/1556#issuecomment-369463910
- elif (( $G_HW_MODEL > 9 && $G_HW_MODEL < 15 )); then
+ sed -i "/^fdt resize/{s/$/\
+fdt rm /ethernet@$identifier rockchip,bugged_tx_coe\
+fdt rm /ethernet@$identifier snps,force_thresh_dma_mode\
+fdt set /ethernet@$identifier snps,txpbl <0x21>/;q}" /boot/boot.cmd
+ mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
+
+ fi
+
+ # - Odroids FFmpeg fix for Meveric images. Prefer debian.org over Meveric for backports: https://github.com/MichaIng/DietPi/issues/1273 + https://github.com/MichaIng/DietPi/issues/1556#issuecomment-369463910
+ elif [[ $G_HW_MODEL == 1[0-5] ]] && ls /etc/apt/sources.list.d/meveric*.list &> /dev/null; then
rm -f /etc/apt/preferences.d/meveric*
cat << _EOF_ > /etc/apt/preferences.d/dietpi-meveric-backports
Package: *
-Pin: release a=jessie-backports
+Pin: release a=stretch-backports
Pin: origin "fuzon.co.uk"
Pin-Priority: 99
Package: *
-Pin: release a=jessie-backports
+Pin: release a=stretch-backports
Pin: origin "oph.mdrjr.net"
Pin-Priority: 99
_EOF_
@@ -1527,7 +1568,6 @@ _EOF_
# - ARMbian increase console verbose
[[ -f '/boot/armbianEnv.txt' ]] && sed -i '/verbosity=/c\verbosity=7' /boot/armbianEnv.txt
-
#------------------------------------------------------------------------------------------------
echo ''
G_DIETPI-NOTIFY 2 '-----------------------------------------------------------------------------------'
@@ -1539,48 +1579,40 @@ _EOF_
l_message='Enable Dropbear autostart' G_RUN_CMD sed -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear
G_DIETPI-NOTIFY 2 'Configuring services'
-
/DietPi/dietpi/dietpi-services stop
/DietPi/dietpi/dietpi-services dietpi_controlled
G_DIETPI-NOTIFY 2 'Mask cron until 1st run setup is completed'
-
G_RUN_CMD systemctl mask cron
G_DIETPI-NOTIFY 2 'Running general cleanup of misc files'
-
# - Remove Bash history file
[[ -f '/root/.bash_history' ]] && rm /root/.bash_history
rm -f /home/*/.bash_history
-
# - Remove Nano history file
[[ -f '/root/.nano_history' ]] && rm /root/.nano_history
rm -f /home/*/.nano_history
G_DIETPI-NOTIFY 2 'Removing swapfile from image'
-
/DietPi/dietpi/func/dietpi-set_swapfile 0 /var/swap
[[ -e '/var/swap' ]] && rm /var/swap # still exists on some images...
-
- # - re-enable for next run
+ # - Re-enable for next run
G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_SIZE=' 'AUTO_SETUP_SWAPFILE_SIZE=1' /DietPi/dietpi.txt
G_DIETPI-NOTIFY 2 'Resetting boot.ini, config.txt, cmdline.txt etc'
# - PineA64 - delete ethaddr from uEnv.txt file
- (( $G_HW_MODEL == 40 )) && [[ -f /boot/uEnv.txt ]] && sed -i '/^ethaddr/ d' /boot/uEnv.txt
+ [[ $G_HW_MODEL == 40 && -f '/boot/uEnv.txt' ]] && sed -i '/^ethaddr/ d' /boot/uEnv.txt
# - Set Pi cmdline.txt back to normal
[[ -f '/boot/cmdline.txt' ]] && sed -i 's/ rootdelay=10//g' /boot/cmdline.txt
G_DIETPI-NOTIFY 2 'Generating default wpa_supplicant.conf'
-
/DietPi/dietpi/func/dietpi-wifidb 1
# Move to /boot/ so users can modify as needed for automated
G_RUN_CMD mv /var/lib/dietpi/dietpi-wifi.db /boot/dietpi-wifi.txt
G_DIETPI-NOTIFY 2 'Disabling generic BT by default'
-
/DietPi/dietpi/func/dietpi-set_hardware bluetooth disable
# - Set WiFi
@@ -1603,6 +1635,9 @@ _EOF_
if (( $G_HW_ARCH == 10 )); then
l_message='Detecting additional OS installed on system' G_RUN_CMD os-prober
+ # Purge "os-prober" again
+ G_AGP os-prober
+ G_AGA
# - Native PC/EFI (assume x86_64 only possible)
if dpkg-query -s 'grub-efi-amd64' &> /dev/null && [[ -d '/boot/efi' ]]; then
@@ -1624,39 +1659,27 @@ _EOF_
fi
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
- # - The same for firmware-intel-sound (sound over HDMI?) on intel CPU devices
- # - Purge "os-prober" from previous step as well
- G_AGP alsa-utils firmware-intel-sound os-prober
- G_AGA
G_DIETPI-NOTIFY 2 'Setting default CPU gov'
-
/DietPi/dietpi/func/dietpi-set_cpu
G_DIETPI-NOTIFY 2 'Clearing log files'
-
/DietPi/dietpi/func/dietpi-logclear 2
G_DIETPI-NOTIFY 2 'Resetting DietPi generated globals/files'
-
rm /DietPi/dietpi/.??*
G_DIETPI-NOTIFY 2 'Set init .install_stage to -1 (first boot)'
-
echo -1 > /DietPi/dietpi/.install_stage
G_DIETPI-NOTIFY 2 'Writing PREP information to file'
-
cat << _EOF_ > /DietPi/dietpi/.prep_info
$IMAGE_CREATOR
$PREIMAGE_INFO
_EOF_
G_DIETPI-NOTIFY 2 'Generating GPL license readme'
-
cat << _EOF_ > /var/lib/dietpi/license.txt
-----------------------
DietPi - GPLv2 License:
@@ -1672,7 +1695,6 @@ You should have received a copy of the GNU General Public License along with thi
_EOF_
G_DIETPI-NOTIFY 2 'Disabling and clearing APT cache'
-
/DietPi/dietpi/func/dietpi-set_software apt-cache cache disable
/DietPi/dietpi/func/dietpi-set_software apt-cache clean
@@ -1694,19 +1716,13 @@ _EOF_
fi
l_message='Enabling first boot installation process' G_RUN_CMD systemctl enable dietpi-firstboot
- G_DIETPI-NOTIFY 2 'Storing DietPi version info'
-
+ G_DIETPI-NOTIFY 2 'Storing DietPi version info:'
G_CONFIG_INJECT 'DEV_GITBRANCH=' "DEV_GITBRANCH=$G_GITBRANCH" /DietPi/dietpi.txt
G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$G_GITOWNER" /DietPi/dietpi.txt
-
- # Reduce sub_version by 1, allows us to create image, prior to release and patch if needed.
- ((G_DIETPI_VERSION_SUB--))
G_VERSIONDB_SAVE
-
G_RUN_CMD cp /DietPi/dietpi/.version /var/lib/dietpi/.dietpi_image_version
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
diff --git a/README.md b/README.md
index 631e9e625c..d736c2faf6 100644
--- a/README.md
+++ b/README.md
@@ -7,22 +7,18 @@
optimised • simplified • for everyone
- find out more
- •
- download image
+ find out more • download image
- Optional "ready to run" optimised software choices with dietpi-software.
-
+ Optional "ready to run" optimised software choices with dietpi-software.
Feature rich configuration tool for your device with dietpi-config.
- DietPi's web hosting is powered by
- myVirtualServer.
+ DietPi's web hosting is powered by myVirtualServer.
A wide range of SBCs and VMs are supported. Click here for the full list.
@@ -59,17 +55,11 @@ _Joined 2016-06-08_
DietPi forum co-administrator, management, support, testing and valuable feedback.
-#### K-Plan
+#### sal666
-_Joined 2016-01-01_
+_Joined 2017-07-26_
-Contributions to the DietPi in general, in-depth testing, bug finding and valuable feedback, forum moderator.
-
-#### ZombieVirus
-
-_Joined 2016-03-20_
-
-DietPi forum moderator and version history maintainer on forums.
+Creator and maintainer of the Clonezilla based installer images for x86_64 UEFI systems.
---
@@ -86,6 +76,18 @@ https://github.com/MichaIng/DietPi/issues/474
### Previous/Inactive Contributors
+#### K-Plan
+
+_Joined 2016-01-01_
+
+Contributions to the DietPi in general, in-depth testing, bug finding and valuable feedback, forum moderator.
+
+#### ZombieVirus
+
+_Joined 2016-03-20_
+
+DietPi forum moderator and version history maintainer on forums.
+
#### Rhkean
_Joined 2018-03-01_
@@ -195,9 +197,12 @@ Links to additional software used in DietPi and their source and build instructi
- [Raspberry](https://github.com/raspberrypi) [Pi](https://github.com/RPi-Distro)
- [Odroid](https://github.com/hardkernel?tab=repositories)
- [Sparky](https://github.com/sparkysbc?tab=repositories) [SBC](https://github.com/sparky-sbc/sparky-test)
+- [RockChip](https://github.com/rockchip-linux/rk-rootfs-build)
- [FriendlyARM](https://github.com/friendlyarm?tab=repositories)
+- [Armbian](https://github.com/armbian)
- [X.Org-X-Server](https://www.x.org/archive//individual/)
- [LXDE desktop](https://github.com/LXDE)
+- [LXQt desktop](https://github.com/lxqt)
- [Xfce desktop](https://git.xfce.org/)
- [MATE desktop](https://github.com/mate-desktop)
- [GNUstep](https://github.com/gnustep)
@@ -209,33 +214,39 @@ Links to additional software used in DietPi and their source and build instructi
- [MiniDLNA](https://sourceforge.net/p/minidlna/git/ci/master/tree/)
- [MPD](https://github.com/MusicPlayerDaemon/MPD)
- [YMPD](https://github.com/notandy/ympd)
-- [phpBB](https://github.com/phpbb/phpbb)
+- [myMPD](https://github.com/jcorporation/myMPD)
- [Apache2](https://github.com/apache)
-- [MariaDB](https://github.com/MariaDB)
+- [Nginx](https://hg.nginx.org/nginx/)
+- [Lighttpd](https://redmine.lighttpd.net/projects/lighttpd/repository)
- [PHP](https://git.php.net/)
+- [PHP OPcache GUI](https://github.com/amnuts/opcache-gui)
+- [MariaDB](https://github.com/MariaDB)
- [phpMyAdmin](https://github.com/phpmyadmin)
+- [Certbot](https://github.com/certbot/certbot)
+- [Pi-hole](https://github.com/pi-hole/pi-hole)
+- [phpBB](https://github.com/phpbb/phpbb)
- [ProFTPD](https://github.com/proftpd)
- [Samba](https://wiki.samba.org/index.php/Using_Git_for_Samba_Development)
- [No-IP Client Binary](https://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/)
+- [Dropbear](https://github.com/mkj/dropbear)
+- [OpenSSH](https://github.com/openssh/openssh-portable)
+- [OpenVPN](https://github.com/OpenVPN)
+- [PiVPN](https://github.com/pivpn/pivpn)
+- [Amiberry](https://github.com/midwan/amiberry)
- [RetroPie Setup Script](https://github.com/petrockblog/RetroPie-Setup)
-- [PiVPN VPN Server](https://github.com/pivpn/pivpn)
- [OpenTyrian](https://bitbucket.org/opentyrian/opentyrian/wiki/Home)
-- [DietPiCam](https://github.com/MichaIng/RPi_Cam_Web_Interface)
-- [PHP OPcache GUI](https://github.com/amnuts/opcache-gui)
-- [Nginx](https://hg.nginx.org/nginx/)
-- [Lighttpd](https://redmine.lighttpd.net/projects/lighttpd/repository)
+- [DietPiCam](https://github.com/silvanmelchior/RPi_Cam_Web_Interface)
- [Deluge](https://dev.deluge-torrent.org/wiki/Development#SourceCode)
-- [Pi-hole](https://github.com/pi-hole/pi-hole)
- [Subsonic](https://sourceforge.net/projects/subsonic/)
- [Airsonic](https://github.com/airsonic/airsonic)
- [LMS/SqueezeBox](https://github.com/Logitech/slimserver)
- [Ampache](https://github.com/ampache/ampache)
- [FFmpeg](https://github.com/FFmpeg/FFmpeg)
-- [CertBot](https://github.com/certbot/certbot)
- [Shairport-Sync](https://github.com/mikebrady/shairport-sync)
-- [OpenVPN](https://github.com/OpenVPN)
- [FreshRSS](https://github.com/FreshRSS/FreshRSS)
- [Folding@Home](https://github.com/FoldingAtHome)
- [OpenBazaar](https://github.com/OpenBazaar/openbazaar-go)
- [Medusa](https://github.com/pymedusa/Medusa)
- [Grafana](https://github.com/grafana/grafana)
+- [Clonezilla](https://gitlab.com/stevenshiau/clonezilla)
+- [Gitea](https://github.com/go-gitea/gitea)
diff --git a/config.txt b/config.txt
index 3da45b4351..f28b417ca9 100644
--- a/config.txt
+++ b/config.txt
@@ -7,23 +7,23 @@
#hdmi_safe=1
# Uncomment to adjust the HDMI signal strength if you have interferences, blanking, or no display.
-# - Values from "0" to "11" are allowed, use values above "7" only if required, e.g. with very long HDMI cable.
-# - Default on first RPi1 is "2" and on RPi2 and above: "5"
+# - Values from "0" to "11" are allowed, use values above "7" only if required, e.g. with very long HDMI cable.
+# - Default on first RPi1 A/B is "2", else "5", on RPi4 this setting is ignored.
#config_hdmi_boost=5
# Uncomment if HDMI display is not detected and composite is being outputted.
#hdmi_force_hotplug=1
-# Set the following two settings to "1" to disable video output and framebuffer completely.
-# NB: This will lead to some error messages on boot, which can be safely ignored.
+# Uncomment to disable HDMI even if plugged, e.g. to force composite output.
#hdmi_ignore_hotplug=1
-#hdmi_ignore_composite=1
# Uncomment to force a console size. By default it will be display's size minus overscan.
#framebuffer_width=1280
#framebuffer_height=720
-# SDTV_MODES
+# Uncomment to enable SDTV/composite output on RPi4. This has no effect on previous RPi models.
+#enable_tvout=1
+# SDTV mode
#sdtv_mode=0
# Uncomment to force a specific HDMI mode (this will force VGA).
@@ -52,8 +52,8 @@ display_hdmi_rotate=0
lcd_rotate=0
#-------RPi camera module-------
-start_x=0
-disable_camera_led=0
+#start_x=1
+#disable_camera_led=1
#-------GPU memory splits-------
gpu_mem_256=16
@@ -63,38 +63,34 @@ gpu_mem_1024=16
#-------Max USB current---------
max_usb_current=1
-#-------Disable Pi splash screen on boot-----------
+#-------Boot splash screen------
disable_splash=1
-#-------SoundCard-------
+#-------Onboard sound----------
dtparam=audio=off
-#-------I²C-------------
+#-------I2C-------------
dtparam=i2c_arm=off
dtparam=i2c1=off
-i2c_arm_baudrate=100000
+#dtparam=i2c_arm_baudrate=100000
#-------SPI-------------
dtparam=spi=off
#-------Serial/UART-----
-# NB: Enabled for 1st run only, if you want to keep this setting, please set CONFIG_SERIAL_CONSOLE_ENABLE=1 in /DietPi/dietpi.txt.
-# NB: "enable_uart=1" will forcefully set "core_freq=250" unless "force_turbo=1" is set as well.
+# NB: Enabled for 1st run only. If you want to keep this setting, please set CONFIG_SERIAL_CONSOLE_ENABLE=1 in dietpi.txt before 1st boot.
+# NB: "enable_uart=1" will forcefully set "core_freq=250" on WiFi/BT-capable RPi models, unless "force_turbo=1" is set as well.
enable_uart=1
#-------Overclock-------
temp_limit=65
-# Initial turbo currently leads to CPU not being throttled down by CPU governor: https://github.com/MichaIng/DietPi/issues/1836
-#initial_turbo=20
-force_turbo=0
+initial_turbo=20
#over_voltage=0
#arm_freq=900
#core_freq=250
#sdram_freq=400
-#arm_freq_min=700
+#arm_freq_min=300
#core_freq_min=250
#sdram_freq_min=400
-
-# Note To Self, NEVER enable L2 cache, breaks most X based applications that were not compiled with L2 cache enabled.
diff --git a/dietpi.txt b/dietpi.txt
index ca17106c8a..7de7260e56 100644
--- a/dietpi.txt
+++ b/dietpi.txt
@@ -20,7 +20,7 @@ AUTO_SETUP_TIMEZONE=Europe/London
##### Networking Options #####
# Enable Ethernet or WiFi adapter: 1=enable | 0=disable
-# - If both Ethernet and WiFi are enabled, WiFi will take priority and Ethernet will be disabled.
+# - If both Ethernet and WiFi are enabled, WiFi will take priority and Ethernet will be disabled.
# - If using WiFi, please edit dietpi-wifi.txt to pre-enter credentials.
AUTO_SETUP_NET_ETHERNET_ENABLED=1
AUTO_SETUP_NET_WIFI_ENABLED=0
@@ -59,7 +59,7 @@ AUTO_UNMASK_LOGIND=0
# Custom Script (post-networking and post-DietPi install)
# - Allows you to automatically execute a custom script at the end of DietPi install.
# - Option 0 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically.
-# - Option 1 = Host your script online, then use e.g. AUTO_SETUP_CUSTOM_SCRIPT_EXEC=http://myweb.com/myscript.sh and it will be downloaded and executed automatically.
+# - Option 1 = Host your script online, then use e.g. AUTO_SETUP_CUSTOM_SCRIPT_EXEC=https://myweb.com/myscript.sh and it will be downloaded and executed automatically.
# - Executed script log: /var/tmp/dietpi/logs/dietpi-automation_custom_script.log
AUTO_SETUP_CUSTOM_SCRIPT_EXEC=0
@@ -79,7 +79,7 @@ AUTO_SETUP_RAMLOG_MAXSIZE=50
# - This will be ignored if you have manually selected any webserver stack.
AUTO_SETUP_WEB_SERVER_INDEX=-2
-# DietPi-Autostart: 0=Console | 7=Console autologin | 1=Kodi | 2=Desktop autologin | 16=Desktop | 3=RetroPie | 4=OpenTyrian | 5=DietPi-Cloudshell | 6=Uae4ARM fastboot | 8=Uae4ARM standard boot | 9=DDX-Rebirth | 10=CAVA Spectrum | 11=Chromium kiosk | 14=Custom autostart service
+# DietPi-Autostart: 0=Console | 7=Console autologin | 1=Kodi | 2=Desktop autologin | 16=Desktop | 3=RetroPie | 4=OpenTyrian | 5=DietPi-Cloudshell | 6=Amiberry fast boot | 8=Amiberry standard boot | 9=DDX-Rebirth | 10=CAVA Spectrum | 11=Chromium kiosk | 14=Custom autostart service
# - This will be effective on 2nd boot, after firstrun update and installs have been done.
# - Related software titles must be installed either on firstrun installs or via AUTO_SETUP_AUTOMATED=1 + AUTO_SETUP_INSTALL_SOFTWARE_ID (see below).
AUTO_SETUP_AUTOSTART_TARGET_INDEX=0
@@ -101,12 +101,10 @@ AUTO_SETUP_GLOBAL_PASSWORD=dietpi
# Software to automatically install
# - List of available software IDs: https://github.com/MichaIng/DietPi/wiki/DietPi-Software-list
-# - Add as many entries as you wish, one each line, without the leading "#".
-# - DietPi will automatically install all pre-reqs (eg: ALSA/XSERVER for desktops etc)
-# - Examples:
-#AUTO_SETUP_INSTALL_SOFTWARE_ID=23 # will install LXDE desktop
-#AUTO_SETUP_INSTALL_SOFTWARE_ID=74 # will install LAMP webserver stack
-#AUTO_SETUP_INSTALL_SOFTWARE_ID=44 # will install Transmission Bittorrent downloader
+# - Add as many entries as you wish, one each line.
+# - DietPi will automatically install all pre-reqs (e.g. ALSA/X11 for desktops etc)
+# - E.g. the following (without the leading "#") will install the LXDE desktop automatically on first boot:
+#AUTO_SETUP_INSTALL_SOFTWARE_ID=23
#------------------------------------------------------------------------------------------------------
# D I E T - P I
@@ -120,25 +118,25 @@ SURVEY_OPTED_IN=-1
# D I E T - P I
# DietPi-Config settings
#------------------------------------------------------------------------------------------------------
-# CPU Governor: ondemand | powersave | performance | conservative
+# CPU Governor: powersave | conservative | ondemand | performance
CONFIG_CPU_GOVERNOR=ondemand
+# Ondemand Sampling Rate | Min value: 10000 microseconds (10ms)
+CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000
+# Ondemand Sampling Down Factor: Samling Rate * Down Factor / 1000 = ms (40 = 1000ms when sampling rate is 25000)
+CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=40
+# Throttle Up Percentage: Percentage of average CPU usage during samling rate at which CPU will be throttled up/down
CONFIG_CPU_USAGE_THROTTLE_UP=50
# CPU Frequency Limits: Disabled=disabled
# - Intel CPUs use a percentage value (%) from 0-100, eg: 55
# - All other devices must use a specific MHz value, eg: 1600
+# - Has no effect on RPi, please set "arm_freq" and "arm_freq_min" in config.txt instead.
CONFIG_CPU_MAX_FREQ=Disabled
CONFIG_CPU_MIN_FREQ=Disabled
# Disable Intel-based turbo/boost stepping. This flag should not be required, setting <100% MAX frequency should disable Turbo on Intel CPUs.
CONFIG_CPU_DISABLE_TURBO=0
-# Sampling Rate: Min value 10000 microseconds (10ms)
-CONFIG_CPU_ONDEMAND_SAMPLE_RATE=25000
-
-# Sampling Down Factor: Samling rate * down factor / 1000 = Milliseconds (40 = 1000ms when sampling rate is 25000)
-CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=80
-
# System-wide proxy settings
# - Do not modify, you must use dietpi-config > "Network Options: Adapters" to apply
CONFIG_PROXY_ADDRESS=MyProxyServer.com
@@ -190,7 +188,7 @@ CONFIG_APT_RASPBIAN_MIRROR=http://raspbian.raspberrypi.org/raspbian
CONFIG_APT_DEBIAN_MIRROR=https://deb.debian.org/debian/
# NTP mirror, applied to /etc/ntp.conf
-# - For a full list, please see: http://www.pool.ntp.org
+# - For a full list, please see: https://www.ntppool.org/zone/@
# - Please remove the initial integer and full stop from the value (removing "0."), eg: debian.pool.ntp.org
CONFIG_NTP_MIRROR=debian.pool.ntp.org
diff --git a/dietpi/boot b/dietpi/boot
index 187bd84b54..fcb1a56512 100644
--- a/dietpi/boot
+++ b/dietpi/boot
@@ -9,7 +9,7 @@
#////////////////////////////////////
#
# Info:
- # - Filename: /DietPi/dietpi/boot
+ # - Filename: /{DietPi,boot}/dietpi/boot
# - Activates on boot from dietpi-boot.service
#////////////////////////////////////
@@ -62,9 +62,6 @@
command -v iw &> /dev/null && iw reg set "$(grep -m1 '^[[:blank:]]*CONFIG_WIFI_COUNTRY_CODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')" &
#----------------------------------------------------------------
# Network failure workarounds
- # - Jessie service fails to start: https://github.com/MichaIng/DietPi/issues/2075#issuecomment-424747579
- (( $G_DISTRO == 3 )) && systemctl start networking
-
# - Failsafe, bring up interfaces, if somehow not done by networking.service. If those are up already, nothing will happen.
if grep -qiE '^[[:blank:]]*(allow-hotplug|auto)[[:blank:]]+wlan' /etc/network/interfaces; then
@@ -110,18 +107,18 @@
# Pre-installed image, 1st run
if (( $G_DIETPI_INSTALL_STAGE == 10 )); then
- # - Create swap file
- local swap_size=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ # Create swap file
+ swap_size=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
disable_error=1 G_CHECK_VALIDINT "$swap_size" 0 || swap_size=1
- local swap_location=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ swap_location=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
[[ $swap_location ]] || swap_location='/var/swap'
/DietPi/dietpi/func/dietpi-set_swapfile $swap_size "$swap_location"
- # - Run survey
+ # Run survey
[[ -f '/DietPi/dietpi/.dietpi-survey' ]] && rm /DietPi/dietpi/.dietpi-survey
/DietPi/dietpi/dietpi-survey 1 &> /dev/null &
- # - Continue with normal boot
+ # Continue with normal boot
G_DIETPI_INSTALL_STAGE=2
echo $G_DIETPI_INSTALL_STAGE > /DietPi/dietpi/.install_stage
diff --git a/dietpi/dietpi-autostart b/dietpi/dietpi-autostart
index 6016eaaa51..92a23f5501 100644
--- a/dietpi/dietpi-autostart
+++ b/dietpi/dietpi-autostart
@@ -87,7 +87,7 @@ WantedBy=multi-user.target
_EOF_
systemctl enable dietpi-autostart_custom
- # - Uae4arm special | fast boot via enabled service
+ # - Amiberry fast boot via enabled service
elif (( $AUTO_START_INDEX == 6 )); then
systemctl enable amiberry
@@ -167,16 +167,16 @@ _EOF_
'0' ': Manual login (default)'
'7' ': Automatic login'
'' '●─ Desktops '
- '2' ': Automatic login'
'16' ': LightDM login mask'
+ '2' ': Automatic login'
'' '●─ Browser Kiosk '
- '11' ': Chromium - Dedicated use, without desktop'
+ '11' ': Chromium - Dedicated use without desktop'
'' '●─ Media '
'1' ': Kodi'
'10' ': CAVA Spectrum'
'' '●─ Gaming/Emulation '
- '6' ': AmiBerry - Fast boot'
- '8' ': AmiBerry - Standard boot'
+ '6' ': Amiberry fast boot'
+ '8' ': Amiberry standard boot'
'3' ': RetroPie'
'9' ': DXX-Rebith - Descent 1/2'
'4' ': OpenTyrian'
@@ -193,11 +193,11 @@ _EOF_
AUTO_START_INDEX=$G_WHIP_RETURNED_VALUE
- # AmiBerry fast boot info
+ # Amiberry fast boot info
if (( $AUTO_START_INDEX == 6 )); then
- G_WHIP_MSG 'AmiBerry: (Fast boot):\nA highly optimized and tweaked boot mode.
-This mode allows for a < 2.5 second boot on a RPi 3, into AmiBerry.\n\nIf you experience boot issues with this mode, please try (Standard Boot)'
+ G_WHIP_MSG 'Amiberry fast boot:\nA highly optimised and tweaked boot mode.
+This mode allows for a < 2.5 second boot on an RPi3, into Amiberry.\n\nIf you experience boot issues with this mode, please try the "standard boot" option.'
# Chromium prompt for URL
elif (( $AUTO_START_INDEX == 11 )); then
@@ -232,7 +232,7 @@ _EOF_
G_WHIP_MSG 'A template script has been created:\n - /var/lib/dietpi/dietpi-autostart/custom.sh\n
Please edit this file and enter the required commands you wish to launch. DietPi will then execute this script during boot.'
- fi
+ fi
fi
diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup
index e0f5556c3e..8f10a849c1 100644
--- a/dietpi/dietpi-backup
+++ b/dietpi/dietpi-backup
@@ -9,7 +9,7 @@
#////////////////////////////////////
#
# Info:
- # - filename /DietPi/dietpi/dietpi-backup
+ # - Filename: /{DietPi,boot}/dietpi/dietpi-backup
# - Allows for a complete system back and restore of the linux filesystem (/)
#
# Usage:
@@ -22,24 +22,19 @@
# - /DietPi/dietpi/dietpi-backup 1 /mnt/MyDirectoryTarget = Backup
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Backup'
G_CHECK_ROOT_USER
G_CHECK_ROOTFS_RW
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- G_EXIT_CUSTOM(){
+ # Cleaup left over tmp files
+ G_EXIT_CUSTOM(){ [[ -f $FP_FILTER_INCLUDE_EXCLUDE ]] && rm $FP_FILTER_INCLUDE_EXCLUDE; }
- # Cleaup left over tmp files
- [[ -f $FP_FILTER_INCLUDE_EXCLUDE ]] && rm $FP_FILTER_INCLUDE_EXCLUDE
-
- }
-
- #Grab Input
- INPUT=0
- disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1
+ # Grab Input
+ disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0
#/////////////////////////////////////////////////////////////////////////////////////
# Backup System
@@ -48,19 +43,19 @@
FP_LOG='/var/log/dietpi-backup.log'
- #Backup Filepaths
+ # Backup Filepaths
FP_SOURCE='/'
FP_TARGET_BACKUP='/mnt/dietpi-backup'
G_FP_DIETPI_USERDATA_ACTUAL=$(readlink -f /mnt/dietpi_userdata)
- #file applied to successful backups (stored in "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME"
+ # File applied to successful backups (stored in "$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME"
BACKUP_STATS_FILENAME='.dietpi-backup_stats'
- #Exclude/include file
+ # Exclude/include file
FP_FILTER_INCLUDE_EXCLUDE='/tmp/.dietpi-backup_filter_inc_exc'
FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP='/DietPi/dietpi/.dietpi-backup_inc_exc'
- #Supported filesystems
+ # Supported filesystems
TARGET_FILESYSTEM_TYPE=0
TARGET_DIRECTORY_SUPPORTED=0
aSUPPORTED_FILESYSTEMS=(
@@ -74,19 +69,19 @@
)
- #rsync options
+ # rsync options
RSYNC_RUN_OPTIONS_BACKUP="-aH --info=name0 --info=progress2 --delete --delete-excluded --exclude-from=$FP_FILTER_INCLUDE_EXCLUDE"
RSYNC_RUN_OPTIONS_RESTORE="-aH --info=name0 --info=progress2 --delete-after --exclude-from=$FP_FILTER_INCLUDE_EXCLUDE"
RSYNC_LOGGING_OPTIONS="-v --log-file=$FP_LOG"
- #Date format for logs
- Print_Date(){ echo "$(date +"%d-%m-%Y %H:%M")"; }
+ # Date format for logs
+ Print_Date(){ date +"%d-%m-%Y %H:%M"; }
Create_Filter_Include_Exclude(){
- #Default - Include/Exclude
+ # Default - Include/Exclude
cat << _EOF_ > $FP_FILTER_INCLUDE_EXCLUDE
-#Global - Folders
+# Global - Dirs
- $FP_TARGET_BACKUP/
+ $G_FP_DIETPI_USERDATA_ACTUAL/
+ $G_FP_DIETPI_USERDATA/
@@ -99,14 +94,14 @@
- /tmp/
- /run/
-#Apt package cache (.deb)
+# APT package cache (.deb)
- /var/cache/apt/archives/
-#Manpages / Docs
+# Manpages / Docs
- /usr/share/man/
- /usr/share/doc/
-#Global - Files
+# Global - Files
- /var/swap
- .swap*
- $FP_LOG
@@ -115,32 +110,24 @@
- fake-hwclock.data
- *.tmp
-#MS Windows specific
+# MS Windows specific
- Thumbs.db
- desktop.ini
_EOF_
- # - Add users filter list
- if [[ -f $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP ]]; then
-
- cat $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP >> $FP_FILTER_INCLUDE_EXCLUDE
-
- fi
+ # Add users filter list
+ [[ -f $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP ]] && cat $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP >> $FP_FILTER_INCLUDE_EXCLUDE
}
Services_Stop(){
/DietPi/dietpi/dietpi-services stop
- killall -w rsync &> /dev/null # :https://github.com/MichaIng/DietPi/issues/1869#issuecomment-400036370
+ killall -w rsync &> /dev/null # https://github.com/MichaIng/DietPi/issues/1869#issuecomment-400036370
}
- Services_Start(){
-
- /DietPi/dietpi/dietpi-services start
-
- }
+ Services_Start(){ /DietPi/dietpi/dietpi-services start; }
Run_Backup(){
@@ -148,33 +135,33 @@ _EOF_
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT"
- #Check valid FS
+ # Check valid FS
Check_Supported_Directory_Location
- #Filesystem supported
+ # Filesystem supported
if (( $TARGET_DIRECTORY_SUPPORTED )); then
Services_Stop
- #Generate target dir.
+ # Generate target dir.
mkdir -p "$FP_TARGET_BACKUP"
- #Error: Unable to create target folder.
+ # Error: Unable to create target folder.
if [[ ! -d $FP_TARGET_BACKUP ]]; then
G_WHIP_MSG "$RSYNC_MODE_TEXT Failed:\n\nUnable to create $FP_TARGET_BACKUP"
- #Error: Rsync is already running
+ # Error: Rsync is already running
elif pgrep 'rsync' &> /dev/null; then
Error_Rsync_Already_Running
else
- #Start Backup
+ # Start Backup
echo -e "DietPi-Backup Log File. $(date +"%d-%m-%Y_%H%M")\n\n" > $FP_LOG
- #Generate Exclude/Include lists
+ # Generate Exclude/Include lists
Create_Filter_Include_Exclude
while :
@@ -227,14 +214,14 @@ _EOF_
fi
- # - done
+ # Done
break
done
log=1 G_WHIP_VIEWFILE $FP_LOG
- #return to main menu
+ # Return to main menu
TARGETMENUID=0
fi
@@ -251,15 +238,15 @@ _EOF_
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$RSYNC_MODE_TEXT"
- #Check valid FS
+ # Check valid FS
Check_Supported_Directory_Location
- #Filesystem supported
+ # Filesystem supported
if (( $TARGET_DIRECTORY_SUPPORTED )); then
Services_Stop
- #Error: Backup not found
+ # Error: Backup not found
if [[ ! -f $FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME ]]; then
G_DIETPI-NOTIFY 2 "No Backup was found in $FP_TARGET_BACKUP"
@@ -267,15 +254,15 @@ _EOF_
G_WHIP_MSG "$RSYNC_MODE_TEXT Failed:\n\n$FP_TARGET_BACKUP/$BACKUP_STATS_FILENAME does not exist\n\nHave you created a backup?"
- #Error: Rsync is already running
+ # Error: Rsync is already running
elif pgrep 'rsync' &> /dev/null; then
Error_Rsync_Already_Running
- #Restore
+ # Restore
else
- #Generate Exclude/Include lists
+ # Generate Exclude/Include lists
Create_Filter_Include_Exclude
G_DIETPI-NOTIFY 2 "$RSYNC_MODE_TEXT $FP_TARGET_BACKUP: in progress, please wait..."
@@ -297,7 +284,7 @@ _EOF_
log=1 G_WHIP_VIEWFILE $FP_LOG
- # - done
+ # Done
TARGETMENUID=0
fi
@@ -320,10 +307,10 @@ _EOF_
Error_DietpiUserdata_Directory
- #Check location contains /mnt/
+ # Check location contains /mnt/
elif [[ $FP_TARGET_BACKUP == '/mnt/'* ]]; then
- #Generate the target directory if it doesnt exist. So we can check what filesystem it will be.
+ # 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
@@ -332,7 +319,7 @@ _EOF_
fi
- TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET_BACKUP | sed -n 2p | mawk '{print $2}')
+ TARGET_FILESYSTEM_TYPE=$(df -T $FP_TARGET_BACKUP | mawk 'NR == 2 {print $2}')
for ((i=0; i<${#aSUPPORTED_FILESYSTEMS[@]}; i++))
do
@@ -345,21 +332,13 @@ _EOF_
done
- #Delete directory if tested
- if (( $directory_generated )); then
-
- rm -R "$FP_TARGET_BACKUP"
-
- fi
-
- #Not ext2/3/4
- if (( ! $TARGET_DIRECTORY_SUPPORTED )); then
+ # Delete directory if tested
+ (( $directory_generated )) && rm -R "$FP_TARGET_BACKUP"
- Error_Filesystem_Not_Supported
+ # Not ext2/3/4
+ (( $TARGET_DIRECTORY_SUPPORTED )) || Error_Filesystem_Not_Supported
- fi
-
- #Not inside /mnt
+ # Not inside /mnt
else
Error_Not_Mnt_Directory
@@ -371,22 +350,11 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Settings File
#/////////////////////////////////////////////////////////////////////////////////////
- #Settings File
FP_DIETPIBACKUP_SETTINGS='/DietPi/dietpi/.dietpi-backup_settings'
- Write_Settings_File(){
-
- cat << _EOF_ > $FP_DIETPIBACKUP_SETTINGS
-FP_TARGET_BACKUP=$FP_TARGET_BACKUP
-_EOF_
-
- }
-
- Read_Settings_File(){
-
- [[ -f $FP_DIETPIBACKUP_SETTINGS ]] && . $FP_DIETPIBACKUP_SETTINGS
+ Write_Settings_File(){ echo "FP_TARGET_BACKUP=$FP_TARGET_BACKUP" > $FP_DIETPIBACKUP_SETTINGS; }
- }
+ Read_Settings_File(){ [[ -f $FP_DIETPIBACKUP_SETTINGS ]] && . $FP_DIETPIBACKUP_SETTINGS; }
#/////////////////////////////////////////////////////////////////////////////////////
# MENUS
@@ -394,9 +362,9 @@ _EOF_
MENU_LASTITEM=''
TARGETMENUID=0
- EXIT_CODE=-1 #Used for 1 time automated running only (eg: G_PROMPT_BACKUP)
+ EXIT_CODE=-1 # Used for 1 time automated running only (eg: G_PROMPT_BACKUP)
- #TARGETMENUID=0
+ # TARGETMENUID=0
Menu_Main(){
local backup_last_completed='Backup not found. Please create one.'
@@ -439,31 +407,25 @@ _EOF_
'Help')
- G_WHIP_MSG "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 - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=256#p255"
+ G_WHIP_MSG "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 - https://dietpi.com/phpbb/viewtopic.php?p=255#p255"
;;
'Delete')
- if G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET_BACKUP"; then
-
- rm -R "$FP_TARGET_BACKUP"
-
- fi
+ G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET_BACKUP" && rm -R "$FP_TARGET_BACKUP"
;;
'Backup')
- G_WHIP_YESNO "The $text_start_mode_desc will be backed up to:\n$FP_TARGET_BACKUP\n\nDo you wish to continue and start the backup?"
- (( $? == 0 )) && Run_Backup
+ G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET_BACKUP\n\nDo you wish to continue and start the backup?" && Run_Backup
;;
'Restore')
- G_WHIP_YESNO "The $text_start_mode_desc will be restored from:\n$FP_TARGET_BACKUP\n\nDo you wish to continue and start the restore?"
- (( $? == 0 )) && Run_Restore
+ G_WHIP_YESNO "The system will be restored from:\n - $FP_TARGET_BACKUP\n\nDo you wish to continue and start the restore?" && Run_Restore
;;
@@ -489,7 +451,7 @@ _EOF_
}
- #TARGETMENUID=1
+ # TARGETMENUID=1
Menu_Set_Directory(){
local current_directory=$FP_TARGET_BACKUP
@@ -513,11 +475,11 @@ _EOF_
echo -e "\n\nSearching /mnt/* for previous backups, please wait... \n \n"
find /mnt -type f -name "$BACKUP_STATS_FILENAME" > $fp_search_results
- #Do we have any results?
+ # Do we have any results?
if (( $(wc -l < $fp_search_results) )); then
readarray search_results_list < $fp_search_results
- #Create List for Whiptail
+ # Create List for Whiptail
G_WHIP_MENU_ARRAY=()
for ((i=0; i<${#search_results_list[@]}; i++))
do
@@ -534,7 +496,7 @@ _EOF_
fi
- #delete[] array
+ # delete[] array
unset search_results_list
[[ -f $fp_search_results ]] && rm $fp_search_results
@@ -566,7 +528,7 @@ _EOF_
else
- #Return to main menu
+ # Return to main menu
TARGETMENUID=0
fi
@@ -625,28 +587,28 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
- #pre-reqs, install if required.
+ # pre-reqs, install if required.
G_AG_CHECK_INSTALL_PREREQ rsync
- #Read settings file
+ # Read settings file
Read_Settings_File
# $2 Optional directory input.
[[ $2 ]] && FP_TARGET_BACKUP=$2
- #Create user inc/exc templates
+ # Create user inc/exc templates
# - Add users filter list
if [[ ! -f $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP ]]; then
cat << _EOF_ > $FP_USER_FILTER_INCLUDE_EXCLUDE_BACKUP
-#$_PROGRAM_NAME | Custom include/exclude filters
+# $G_PROGRAM_NAME | Custom include/exclude filters
#
-#To INCLUDE (+) a file/folder:
+# To INCLUDE (+) a file/folder:
# NB: dietpi_userdata is included by default, as well, if moved to a custom location.
#+ /location/to/my/file
#+ /location/to/my/directory/
#
-#To EXCLUDE (-) a file/folder:
+# To EXCLUDE (-) a file/folder:
# NB: To exclude from a custom located dietpi_userdata, you need to add its symlinked path: /mnt/dietpi_userdata/excludeThis
#- /location/to/my/file
#- /location/to/my/directory/
@@ -656,18 +618,18 @@ _EOF_
fi
#-----------------------------------------------------------------------------
- #Run Backup
+ # Run Backup
if (( $INPUT == 1 )); then
Run_Backup
- #Run Restore
+ # Run Restore
elif (( $INPUT == -1 )); then
Run_Restore
#-----------------------------------------------------------------------------
- #Run menu
+ # Run menu
else
while (( $TARGETMENUID > -1 )); do
@@ -686,7 +648,7 @@ _EOF_
done
- #Save settings
+ # Save settings
Write_Settings_File
fi
diff --git a/dietpi/dietpi-cleaner b/dietpi/dietpi-cleaner
index 742dccb509..57f4fb74e9 100644
--- a/dietpi/dietpi-cleaner
+++ b/dietpi/dietpi-cleaner
@@ -8,13 +8,13 @@
#////////////////////////////////////
#
# Info:
- # - Location: /DietPi/dietpi/dietpi-cleaner
+ # - Location: /{DietPi,boot}/dietpi/dietpi-cleaner
# - Cleans "crap" on users system :)
#
# - Usage
# /DietPi/dietpi/dietpi-cleaner no-input = menu
- # /DietPi/dietpi/dietpi-cleaner 1 = Run Enabled cleaners (no menu).
- # /DietPi/dietpi/dietpi-cleaner 2 = Run All cleaners (no menu).
+ # /DietPi/dietpi/dietpi-cleaner 1 = Run Enabled cleaners (no menu).
+ # /DietPi/dietpi/dietpi-cleaner 2 = Run All cleaners (no menu).
#////////////////////////////////////
# Import DietPi-Globals --------------------------------------------------------------
@@ -54,15 +54,7 @@
Menu_Exit(){
G_WHIP_SIZE_X_MAX=50
- if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then
-
- TARGETMENUID=-1 # Exit
-
- else
-
- TARGETMENUID=0 # Main menu
-
- fi
+ G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 # Exit
}
@@ -85,7 +77,7 @@
)
G_WHIP_BUTTON_CANCEL_TEXT='Exit'
- G_WHIP_MENU "Free up used space and system resources:\n - RootFS usage current = $ROOT_SPACE_USED_CURRENT MB\n - RootFS space cleared = $ROOT_SPACE_FREE_DELTA MB"
+ G_WHIP_MENU "Free up used space and system resources:\n - RootFS usage current = $ROOT_SPACE_USED_CURRENT MiB\n - RootFS space cleared = $ROOT_SPACE_FREE_DELTA MiB"
if (( $? == 0 )); then
case "$G_WHIP_RETURNED_VALUE" in
@@ -136,7 +128,7 @@ Further information:\n - https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=623#p6
else
- G_WHIP_MSG "$_PROGRAM_NAME could not be run as there are no enabled cleaners. Please go to cleaners, then select which you would like to enable."
+ G_WHIP_MSG "$G_PROGRAM_NAME could not be run as there are no enabled cleaners. Please go to cleaners, then select which you would like to enable."
fi
@@ -294,16 +286,15 @@ Would you like to continue and start the cleaning process?" && Run_Cleaners
#/////////////////////////////////////////////////////////////////////////////////////
# Cleaner stats
#/////////////////////////////////////////////////////////////////////////////////////
- # Space free after running cleaner
+ # Space freed after running cleaner
ROOT_SPACE_USED_BEFORE=0
ROOT_SPACE_USED_AFTER=0
ROOT_SPACE_USED_CURRENT=0
ROOT_SPACE_FREE_DELTA='Cleaner has not been run - 0'
- ROOTFS_DEVICE_PATH=$(sed -n 4p /DietPi/dietpi/.hw_model)
Update_Space_Used(){
- ROOT_SPACE_USED_CURRENT=$(df --block-size MB | mawk -v pat="$ROOTFS_DEVICE_PATH" '$0~pat {print $3}' | tr -d 'MB')
+ ROOT_SPACE_USED_CURRENT=$(df -m --output=used / | mawk 'NR==2 {print $1;exit}')
}
@@ -370,13 +361,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..."
Banner_Cleaning
# Find packages and convert into 1 line string
- local string_package_names=''
- while read line
- do
-
- [[ $line ]] && string_package_names+="$line "
-
- done <<< "$(dpkg --get-selections *-dev build-essential git make automake autoconf 2> /dev/null | mawk '{print $1}')"
+ local string_package_names=$(echo $(dpkg --get-selections *-dev build-essential make automake autoconf 2> /dev/null | mawk '{print $1}'))
# Mark for autoremoval
if (( $DRY_RUN )); then
@@ -402,13 +387,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..."
Banner_Cleaning
# Find packages and convert into 1 line string
- local string_package_names=''
- while read line
- do
-
- [[ $line ]] && string_package_names+="$line "
-
- done <<< "$(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}')"
+ local string_package_names=$(echo $(dpkg --get-selections man-db manpages 2> /dev/null | mawk '{print $1}'))
# Mark for autoremoval
if (( $DRY_RUN )); then
@@ -522,7 +501,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..."
if (( ! $DRY_RUN )); then
/DietPi/dietpi/func/dietpi-logclear 1
- rm -vf /var/tmp/dietpi/logs/*
+ rm -vRf /var/tmp/dietpi/logs/*
fi
@@ -536,8 +515,7 @@ $G_PROGRAM_NAME simulation has finished: Press any key to continue..."
if (( ! $DRY_RUN )); then
- apt-get clean
- rm -vf /var/lib/apt/lists/*
+ /DietPi/dietpi/func/dietpi-set_software apt-cache clean
G_AGUP
fi
diff --git a/dietpi/dietpi-cloudshell b/dietpi/dietpi-cloudshell
index 58325ac569..f9e38a61d7 100644
--- a/dietpi/dietpi-cloudshell
+++ b/dietpi/dietpi-cloudshell
@@ -17,22 +17,22 @@
# dietpi-cloudshell 2 = Run + Skip intro
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Cloudshell'
G_CHECK_ROOT_USER
G_INIT_ALLOW_CONCURRENT=1
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- #Grab Input (valid interger)
+ # Grab Input (valid interger)
INPUT=0
disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1
- #Version
+ # Version
DIETPI_CLOUDSHELL_VERSION=9
- #/tmp/.* files used throughout this script.
+ # /tmp/.* files used throughout this script.
FP_TEMP="/tmp/$G_PROGRAM_NAME/.tmp"
BLANK_SCREEN_ACTIVE=0
@@ -40,12 +40,12 @@
BLANK_SCREEN_TIME_HOUR_START=0
BLANK_SCREEN_TIME_HOUR_END=0
- #This will only work if dietpi-cloudshell was started by autostart (login script), as the setterm power options can only be applied when the command originates from the same terminal (no redirects).
+ # This will only work if dietpi-cloudshell was started by autostart (login script), as the setterm power options can only be applied when the command originates from the same terminal (no redirects).
RUN_BLANK_SCREEN_AT_SPECIFIC_TIME(){
local current_hour=$(date +%-H)
- #Turn screen off
+ # Turn screen off
if (( ! $BLANK_SCREEN_ACTIVE )); then
if (( $BLANK_SCREEN_TIME_HOUR_START == $current_hour )); then
@@ -57,7 +57,7 @@
fi
- #Turn screen on
+ # Turn screen on
elif (( $BLANK_SCREEN_TIME_HOUR_END == $current_hour )); then
Disable_Screen_Blanking
@@ -75,7 +75,7 @@
}
- #BC does not allow for printing leading zeros.
+ # BC does not allow for printing leading zeros.
BC_ADD_LEADING_ZERO(){
#$1 = string input
@@ -98,7 +98,7 @@
}
- #Converts a byte int to string, in human readable byte format.
+ # Converts a byte int to string, in human readable byte format.
BYTE_PRINT_CONVERSION(){
local return_value=0
@@ -130,15 +130,15 @@
}
- #Converts a byte int to string, in human readable bit format.
- # - for network data transmission rate (LAN, WLAN, ...)
+ # Converts a byte int to string, in human readable bit format.
+ # - for network data transmission rate (LAN, WLAN, ...)
# - 1MB = 8Mbit | 1Mbit = 0.125MB
- BIT_PRINT_CONVERSION(){
+ BIT_PRINT_CONVERSION(){
local return_value=0
local decimal_count=1
- #$1=byte value
+ # $1=byte value
# - Kbit
if (( $1 < 1000000 )); then
@@ -148,7 +148,7 @@
# - MBit
elif (( $1 < 1000000000 )); then
- return_value="$(bc -l <<< "scale=$decimal_count; $1 * 8 / 1000 / 1000") Mbit"
+ return_value="$(bc -l <<< "scale=$decimal_count; $1 * 8 / 1000 / 1000") Mbit"
# - GBit
else
@@ -157,12 +157,12 @@
fi
- #BC - Add leading zero to start of .* string.
+ # BC - Add leading zero to start of .* string.
return_value=$(BC_ADD_LEADING_ZERO "$return_value")
echo "$return_value"
- }
+ }
Init_Term_Options(){
@@ -183,10 +183,10 @@
C_RESET='\e[0m'
C_REVERSE='\e[7m'
- #C_BOLD makes normal text "brighter"
+ # C_BOLD makes normal text "brighter"
C_BOLD='\e[1m'
- #Colour array
+ # Colour array
#0 WHITE
#1 RED
#2 GREEN
@@ -208,7 +208,7 @@
)
- #user colour
+ # user colour
USER_COLOUR_INDEX=3
C_PERCENT_GRAPH=0
@@ -492,8 +492,7 @@
local index_start=$1
local index_end=$2
-
- #df will endless hang when NFS server is down: https://github.com/MichaIng/DietPi/issues/395
+ # df will endless hang when NFS server is down: https://github.com/MichaIng/DietPi/issues/395
# - So lets run it as another thread so we can kill it if it hangs.
local df_failed=0
rm $FP_TEMP
@@ -862,7 +861,7 @@
Run_Intro(){
- #'--------------------------'
+ #'--------------------------'
clear
local aAnimation=(
@@ -916,20 +915,19 @@
done
- #delete[] array
- unset aAnimation
- unset aBar
+ # delete[] array
+ unset aAnimation aBar
sleep 0.1
}
- #Top banner
+ # Top banner
BANNER_PRINT=0
BANNER_MODE=0
Update_Banner(){
- #Banner Modes
+ # Banner Modes
if (( $BANNER_MODE == 0 )); then
BANNER_PRINT="DietPi - Cloudshell v$DIETPI_CLOUDSHELL_VERSION"
@@ -992,21 +990,21 @@
}
- #$1 $2 = Storage index's to update and display (must be a range of 1 , eg: 0-1 1-2 3-4)
+ # $1 $2 = Storage index's to update and display (must be a range of 1 , eg: 0-1 1-2 3-4)
Update_Scene_1(){
local index_1=$1
local index_2=$2
- #Update data
+ # Update data
Obtain_STORAGE $index_1 $index_2
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
echo -e "$C_RESET $BANNER_PRINT"
- #
+
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE ${STORAGE_NAME[$index_1]}"
echo -e "$C_RESET${STORAGE_PERCENT[$index_1]}"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Used: $C_RESET${STORAGE_USED[$index_1]} / ${STORAGE_TOTAL[$index_1]}"
@@ -1018,18 +1016,18 @@
}
- #DietPi
+ # DietPi
Update_Scene_4(){
- #Update data
+ # Update data
Obtain_DIETPIINFO
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
echo -e "$C_RESET $BANNER_PRINT"
- #
+
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE DietPi: "
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Version ${aCOLOUR[$USER_COLOUR_INDEX]}:$C_RESET $DIETPI_VERSION_CURRENT"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Updates ${aCOLOUR[$USER_COLOUR_INDEX]}:$C_RESET $DIETPI_UPDATE_AVAILABLE"
@@ -1040,18 +1038,18 @@
}
- #NETWORK DETAILS
+ # NETWORK DETAILS
Update_Scene_5(){
- #Update data
+ # Update data
Obtain_NETWORK_DETAILS
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
echo -e "$C_RESET $BANNER_PRINT"
- #
+
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Network Details: "
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} IP : $C_RESET$NETWORK_DETAILS_IP_INT"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Mode : $C_RESET$NETWORK_DETAILS_MODE"
@@ -1063,10 +1061,10 @@
}
- #NETWORK USAGE
+ # NETWORK USAGE
Update_Scene_6(){
- #Update data
+ # Update data
Obtain_NETWORK_USAGE
# - Convert usage values into human readable format. Run before clearing screen due to additional processing (delay)
@@ -1090,14 +1088,13 @@
fi
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
# - Banner does not fit this scene (>= 9 lines)
#echo -e "$C_RESET $BANNER_PRINT"
- #
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Network Usage (TOTAL): "
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Sent : $C_RESET$total_sent_output"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Recieved : $C_RESET$total_recieved_output"
@@ -1112,18 +1109,18 @@
}
- #Memory
+ # Memory
Update_Scene_7(){
- #Update data
+ # Update data
Obtain_MEMORY
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
echo -e "$C_RESET $BANNER_PRINT"
- #
+
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Memory Usage (RAM): "
echo -e "$C_RESET$MEMORY_PERCENT"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Used: $C_RESET$MEMORY_USED MB / $MEMORY_TOTAL MB"
@@ -1135,18 +1132,18 @@
}
- #Pi-hole
+ # Pi-hole
Update_Scene_8(){
- #Update data
+ # Update data
Obtain_PIHOLE
- #Clear screen
+ # Clear screen
clear
- #Banner
+ # Banner
echo -e "$C_RESET $BANNER_PRINT"
- #
+
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]}$C_REVERSE Pi-hole stats (TODAY): "
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} Ads Blocked: $C_RESET$PIHOLE_TOTAL_ADS"
echo -e "$C_RESET${aCOLOUR[$USER_COLOUR_INDEX]} DNS Queries: $C_RESET$PIHOLE_QUERY_COUNT"
@@ -1161,18 +1158,10 @@
#/////////////////////////////////////////////////////////////////////////////////////
# Settings File
#/////////////////////////////////////////////////////////////////////////////////////
- #Define Location
+ # Define Location
FILEPATH_SETTINGS='/DietPi/dietpi/.dietpi-cloudshell'
- Read_Settings_File(){
-
- if [[ -f $FILEPATH_SETTINGS ]]; then
-
- . $FILEPATH_SETTINGS
-
- fi
-
- }
+ Read_Settings_File(){ [[ -f $FILEPATH_SETTINGS ]] && . $FILEPATH_SETTINGS; }
Write_Settings_File(){
@@ -1190,20 +1179,20 @@ BLANK_SCREEN_TIME_HOUR_END=$BLANK_SCREEN_TIME_HOUR_END
_EOF_
- #Add enabled scenes
+ # Add enabled scenes
for ((i=0; i<$MAX_SCENES; i++))
do
- echo -e "aEnabledScenes[$i]=${aEnabledScenes[$i]}" >> $FILEPATH_SETTINGS
+ echo "aEnabledScenes[$i]=${aEnabledScenes[$i]}" >> $FILEPATH_SETTINGS
done
- #Add Drive Paths and Names
+ # Add Drive Paths and Names
for ((i=0; i<$MAX_STORAGE; i++))
do
- echo -e "STORAGE_PATH[$i]='${STORAGE_PATH[$i]}'" >> $FILEPATH_SETTINGS
- echo -e "STORAGE_NAME[$i]='${STORAGE_NAME[$i]}'" >> $FILEPATH_SETTINGS
+ echo "STORAGE_PATH[$i]='${STORAGE_PATH[$i]}'" >> $FILEPATH_SETTINGS
+ echo "STORAGE_NAME[$i]='${STORAGE_NAME[$i]}'" >> $FILEPATH_SETTINGS
done
@@ -1215,32 +1204,24 @@ _EOF_
Init(){
#--------------------------------------------------------------------------------
- #Storage array
+ # Storage array
Init_STORAGE
#--------------------------------------------------------------------------------
- #Load Settings file.
+ # Load Settings file.
Read_Settings_File
#--------------------------------------------------------------------------------
- #VM disable CPU scene
- if (( $G_HW_MODEL == 20 )); then
-
- aEnabledScenes[0]=0
-
- fi
+ # VM disable CPU scene
+ (( $G_HW_MODEL == 20 )) && aEnabledScenes[0]=0
#--------------------------------------------------------------------------------
- #Check and disable scenes if software is not installed:
- # 6 Pi-hole
- if [[ ! -f /etc/pihole/gravity.list ]]; then
-
- aEnabledScenes[8]=0
-
- fi
+ # Check and disable scenes if software is not installed:
+ # - 6 Pi-hole
+ [[ -f '/etc/pihole/gravity.list' ]] || aEnabledScenes[8]=0
#--------------------------------------------------------------------------------
- #Ensure we have at least 1 Scene enabled in the settings file.
+ # Ensure we have at least 1 Scene enabled in the settings file.
local enabled_scene=0
for ((i=0; i<$MAX_SCENES; i++))
do
@@ -1254,7 +1235,7 @@ _EOF_
done
- #No Scenes selected! Override user setting and enable at least 1 scene (dietpi)
+ # No Scenes selected! Override user setting and enable at least 1 scene (dietpi)
if (( $enabled_scene == 0 )); then
aEnabledScenes[4]=1
@@ -1262,7 +1243,7 @@ _EOF_
fi
#--------------------------------------------------------------------------------
- #Update DietPi network shared data: https://github.com/MichaIng/DietPi/issues/359
+ # Update DietPi network shared data: https://github.com/MichaIng/DietPi/issues/359
/DietPi/dietpi/func/obtain_network_details
}
@@ -1270,15 +1251,15 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Start/Stop Control for Menu
#/////////////////////////////////////////////////////////////////////////////////////
- #0=tty1 1=current
+ # 0=tty1 1=current
OUTPUT_DISPLAY_INDEX=0
Menu_Stop(){
- #Service if started.
+ # Service if started.
systemctl stop dietpi-cloudshell
- #Kill all , excluding Menu.
+ # Kill all , excluding Menu.
ps ax | grep '[d]ietpi-cloudshell [1-9]' | mawk '{print $1}' > $FP_TEMP
while read -r line
do
@@ -1291,7 +1272,7 @@ _EOF_
Menu_Start(){
- #Are we starting on the current screen? (eg: from tty1)
+ # Are we starting on the current screen? (eg: from tty1)
local output_current_screen=0
if [[ $(tty) == '/dev/tty1' ]]; then
@@ -1327,32 +1308,24 @@ _EOF_
Init_Term_Options
- #Start Intro
- if (( $RUN_INTRO )); then
+ # Start Intro
+ (( $RUN_INTRO )) && Run_Intro
- Run_Intro
-
- fi
-
- #Set Nice to +10 (not critical)
+ # Set Nice to +10 (not critical)
renice -n 10 $$ &> /dev/null
- #Start display updates
- while true
+ # Start display updates
+ while :
do
- if (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )); then
-
- RUN_BLANK_SCREEN_AT_SPECIFIC_TIME
-
- fi
+ (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )) && RUN_BLANK_SCREEN_AT_SPECIFIC_TIME
- #Disable updates when screen is blanked
+ # Disable updates when screen is blanked
if (( $BLANK_SCREEN_ACTIVE )); then
sleep 60
- #Update enabled scenes
+ # Update enabled scenes
else
if (( ${aEnabledScenes[$SCENE_CURRENT]} )); then
@@ -1381,21 +1354,16 @@ _EOF_
fi
- #Apply refresh rate delay
+ # Apply refresh rate delay
sleep $REFRESH_RATE
fi
- #Scene Switcher
+ # Scene Switcher
((SCENE_CURRENT++))
- #Cap
- if (( $SCENE_CURRENT >= $MAX_SCENES )); then
-
- SCENE_CURRENT=0
-
- fi
-
+ # Cap
+ (( $SCENE_CURRENT >= $MAX_SCENES )) && SCENE_CURRENT=0
fi
@@ -1412,56 +1380,39 @@ _EOF_
Menu_Exit(){
G_WHIP_SIZE_X_MAX=50
- G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"
- if (( $? == 0 )); then
+ if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then
- #Save changes
+ # Save changes
Write_Settings_File
- #exit
+ # exit
TARGETMENUID=-1
else
- #Return to Main Menu
+ # Return to Main Menu
TARGETMENUID=0
fi
}
- #TARGETMENUID=0
+ # TARGETMENUID=0
Menu_Main(){
TARGETMENUID=0
local temp_output_text='Fahrenheit'
- if (( $TEMPERATURE_OUTPUT_TYPE == 1 )); then
-
- temp_output_text='Celsius'
-
- fi
+ (( $TEMPERATURE_OUTPUT_TYPE == 1 )) && temp_output_text='Celsius'
local target_output_text='Main Screen (tty1)'
- if (( $OUTPUT_DISPLAY_INDEX == 1 )); then
-
- target_output_text='Current screen or terminal'
-
- fi
+ (( $OUTPUT_DISPLAY_INDEX == 1 )) && target_output_text='Current screen or terminal'
local bitbyte_output_text='Bit (Kbit, Mbit, Gbit)'
- if (( $NETWORK_USAGE_CURRENT_OUTPUT_TYPE == 1 )); then
-
- bitbyte_output_text='Byte (KB, MB, GB)'
-
- fi
+ (( $NETWORK_USAGE_CURRENT_OUTPUT_TYPE == 1 )) && bitbyte_output_text='Byte (KB, MB, GB)'
local autoscreenoff='Disabled'
- if (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )); then
-
- autoscreenoff='Enabled'
-
- fi
+ (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )) && autoscreenoff='Enabled'
G_WHIP_MENU_ARRAY=(
@@ -1558,7 +1509,7 @@ _EOF_
}
- #TARGETMENUID=1
+ # TARGETMENUID=1
Menu_Colour(){
#Return to main menu
@@ -1581,7 +1532,7 @@ _EOF_
}
- #TARGETMENUID=2
+ # TARGETMENUID=2
Menu_UpdateRate(){
#Return to main menu
@@ -1602,36 +1553,26 @@ _EOF_
)
G_WHIP_DEFAULT_ITEM=$REFRESH_RATE
- G_WHIP_MENU 'Please select the desired delay, between scene changes and updates.'
- if (( $? == 0 )); then
-
- REFRESH_RATE=$G_WHIP_RETURNED_VALUE
-
- fi
+ G_WHIP_MENU 'Please select the desired delay, between scene changes and updates.' && REFRESH_RATE=$G_WHIP_RETURNED_VALUE
}
- #TARGETMENUID=3
+ # TARGETMENUID=3
Menu_SceneSelection(){
- #Return to main menu
- TARGETMENUID=0
+ TARGETMENUID=0 # Return to main menu
- #Get on/off whilptail status
+ # Get on/off whilptail status
local aWhip_OnOff_Status=()
for ((i=0; i<$MAX_SCENES; i++))
do
- #On/Off status
+ # On/Off status
aWhip_OnOff_Status[$i]='on'
- if (( ! ${aEnabledScenes[$i]} )); then
-
- aWhip_OnOff_Status[$i]='off'
-
- fi
+ (( ${aEnabledScenes[$i]} )) || aWhip_OnOff_Status[$i]='off'
done
- #Define options
+ # Define options
local index=0
G_WHIP_CHECKLIST_ARRAY=()
index=0;G_WHIP_CHECKLIST_ARRAY+=($index 'CPU: Temperatures, Usage, frequency and more.' "${aWhip_OnOff_Status[$index]}")
@@ -1644,8 +1585,7 @@ _EOF_
index=7;G_WHIP_CHECKLIST_ARRAY+=($index 'Memory: Stats for RAM and Swapfile usage.' "${aWhip_OnOff_Status[$index]}")
index=8;G_WHIP_CHECKLIST_ARRAY+=($index 'Pi-hole: Stats for Pi-hole. Total Ads blocked etc.' "${aWhip_OnOff_Status[$index]}")
- G_WHIP_CHECKLIST 'Please use the spacebar to toggle which scenes are active.'
- if (( $? == 0 )); then
+ if G_WHIP_CHECKLIST 'Please use the spacebar to toggle which scenes are active.'; then
# - Reset all scenes to 0
for ((i=0; i<$MAX_SCENES; i++))
@@ -1656,7 +1596,7 @@ _EOF_
fi
- #Delete[] array
+ # Delete[] array
unset aWhip_OnOff_Status
# - Enable required scenes
@@ -1669,18 +1609,13 @@ _EOF_
}
- #TARGETMENUID=4
+ # TARGETMENUID=4
Menu_BlankScreenAtTime(){
- #Return to main menu
- TARGETMENUID=0
+ TARGETMENUID=0 # Return to main menu
local blank_screen_at_specific_time_enabled_text='Disabled'
- if (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )); then
-
- blank_screen_at_specific_time_enabled_text='Enabled'
-
- fi
+ (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED )) && blank_screen_at_specific_time_enabled_text='Enabled'
G_WHIP_MENU_ARRAY=(
@@ -1697,11 +1632,7 @@ _EOF_
if [[ $G_WHIP_RETURNED_VALUE == 'Toggle' ]];then
((BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED++))
- if (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED > 1 )); then
-
- BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED=0
-
- fi
+ (( $BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED > 1 )) && BLANK_SCREEN_AT_SPECIFIC_TIME_ENABLED=0
elif [[ $G_WHIP_RETURNED_VALUE == 'Start time' ]];then
@@ -1714,12 +1645,7 @@ _EOF_
done
G_WHIP_DEFAULT_ITEM=$BLANK_SCREEN_TIME_HOUR_START
- G_WHIP_MENU 'Please select which hour (24h) you would like the screen to power off.'
- if (( $? == 0 )); then
-
- BLANK_SCREEN_TIME_HOUR_START=$G_WHIP_RETURNED_VALUE
-
- fi
+ G_WHIP_MENU 'Please select which hour (24h) you would like the screen to power off.' && BLANK_SCREEN_TIME_HOUR_START=$G_WHIP_RETURNED_VALUE
elif [[ $G_WHIP_RETURNED_VALUE == 'End time' ]];then
@@ -1732,12 +1658,7 @@ _EOF_
done
G_WHIP_DEFAULT_ITEM=$BLANK_SCREEN_TIME_HOUR_END
- G_WHIP_MENU 'Please select which hour (24h) you would like the screen to power on.'
- if (( $? == 0 )); then
-
- BLANK_SCREEN_TIME_HOUR_END=$G_WHIP_RETURNED_VALUE
-
- fi
+ G_WHIP_MENU 'Please select which hour (24h) you would like the screen to power on.' && BLANK_SCREEN_TIME_HOUR_END=$G_WHIP_RETURNED_VALUE
fi
@@ -1747,11 +1668,10 @@ _EOF_
}
- #TARGETMENUID=5
+ # TARGETMENUID=5
Menu_Storage(){
- #Return to main menu
- TARGETMENUID=0
+ TARGETMENUID=0 # Return to main menu
G_WHIP_MENU_ARRAY=()
@@ -1778,27 +1698,22 @@ _EOF_
}
-
#/////////////////////////////////////////////////////////////////////////////////////
# MAIN
#/////////////////////////////////////////////////////////////////////////////////////
#-----------------------------------------------------------------------------------
- #Init
+ # Init
Init
#-----------------------------------------------------------------------------------
- #Run menu
+ # Run menu
if (( $INPUT == 0 )); then
- #Start Menu
+ # Start Menu
while (( $TARGETMENUID >= 0 )); do
clear
- if (( $TARGETMENUID == 0 )); then
-
- Menu_Main
-
- elif (( $TARGETMENUID == 1 )); then
+ if (( $TARGETMENUID == 1 )); then
Menu_Colour
@@ -1818,12 +1733,16 @@ _EOF_
Menu_Storage
+ else
+
+ Menu_Main
+
fi
done
#-----------------------------------------------------------------------------------
- #Run DietPi-Cloudshell
+ # Run DietPi-Cloudshell
elif (( $INPUT > 0 )); then
Run_Cloudshell
@@ -1831,12 +1750,11 @@ _EOF_
fi
#-----------------------------------------------------------------------------------
- #Clean up temp files
+ # Clean up temp files
[[ -f $FP_TEMP ]] && rm $FP_TEMP
#-----------------------------------------------------------------------------------
- #Delete[] Global arrays
- unset aCOLOUR
- unset aEnabledScenes
+ # Delete[] Global arrays
+ unset aCOLOUR aEnabledScenes
Destroy_STORAGE
#-----------------------------------------------------------------------------------
exit
diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config
index 079224706d..95082f1c7a 100644
--- a/dietpi/dietpi-config
+++ b/dietpi/dietpi-config
@@ -9,7 +9,7 @@
#////////////////////////////////////
#
# Info:
- # - filename /DietPi/dietpi/dietpi-config
+ # - Filename: /{DietPi,boot}/dietpi/dietpi-config
#
# Usage:
# dietpi-config iMENUINDEX iEXITONBACK
@@ -26,21 +26,24 @@
# Import DietPi-Globals --------------------------------------------------------------
# Grab Inputs
- # - target MENU INDEX (valid interger)
- disable_error=1 G_CHECK_VALIDINT "$1" && TARGETMENUID=$1
+ # - TARGETMENUID (valid positive interger)
+ if disable_error=1 G_CHECK_VALIDINT "$1" 1; then
- # - Exit DietPi-Config when going back to previous menu?
- if disable_error=1 G_CHECK_VALIDINT "$2" 1 1; then
+ TARGETMENUID=$1
+ # Exit DietPi-Config instead of going back to previous menu?
+ if [[ $2 == 1 ]]; then
- EXITONBACK=$2
- TEXT_MENU_BACK='Exit'
+ EXITONBACK=$2
+ TEXT_MENU_BACK='Exit'
+
+ fi
fi
#/////////////////////////////////////////////////////////////////////////////////////
# Obtain Hardware Details
#/////////////////////////////////////////////////////////////////////////////////////
- HW_ONBOARD_WIFI=$(sed -n 10p /DietPi/dietpi/.hw_model)
+ HW_ONBOARD_WIFI=$(mawk 'NR==10' /DietPi/dietpi/.hw_model)
FP_CPU_SCALING_GOV='/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors'
#/////////////////////////////////////////////////////////////////////////////////////
@@ -58,10 +61,9 @@
#/////////////////////////////////////////////////////////////////////////////////////
TARGETMENUID=${TARGETMENUID:-0}
EXITONBACK=${EXITONBACK:-0}
-
TEXT_MENU_BACK=${TEXT_MENU_BACK:-Back}
- WHIP_SELECTION_PREVIOUS=''
+ WHIP_SELECTION_PREVIOUS=''
REBOOT_REQUIRED=0
# Interger min/max value holders
@@ -71,14 +73,14 @@
# TARGETMENUID=0
Menu_Main(){
- G_WHIP_MENU_ARRAY=('1' ': Display Options')
- # Hide Audio and Performance Options on VM
- (( $G_HW_MODEL == 20 )) || G_WHIP_MENU_ARRAY+=(
+ G_WHIP_MENU_ARRAY=(
+ '1' ': Display Options'
'2' ': Audio Options'
- '3' ': Performance Options'
)
+ # Hide performance options on VM
+ (( $G_HW_MODEL == 20 )) || G_WHIP_MENU_ARRAY+=('3' ': Performance Options')
G_WHIP_MENU_ARRAY+=(
'4' ': Advanced Options'
@@ -134,10 +136,6 @@
TARGETMENUID=11
- else
-
- Menu_Exit
-
fi
else
@@ -148,9 +146,9 @@
}
+ # TARGETMENUID=-1, if we are to exit DietPi-Config
Menu_Exit(){
- # TARGETMENUID=-1, if we are to exit DietPi-Config
G_WHIP_SIZE_X_MAX=50
if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then
@@ -208,22 +206,20 @@
TARGETMENUID=0
- G_WHIP_MENU_ARRAY=()
-
if (( $G_HW_MODEL == 21 )); then
- G_WHIP_MENU_ARRAY+=('1' ': Display Driver')
+ G_WHIP_MENU_ARRAY=('1' ': Display Driver')
else
- G_WHIP_MENU_ARRAY+=('1' ': Display Resolution')
+ G_WHIP_MENU_ARRAY=('1' ': Display Resolution')
- # On VM, only offer resolution option
+ # On VM, do not show memory split or LCD panel menus
if (( $G_HW_MODEL != 20 )); then
G_WHIP_MENU_ARRAY+=('2' ': GPU/RAM Memory Split')
- local lcdpanel_text=$(grep -m1 '^[[:blank:]]*CONFIG_LCDPANEL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- G_WHIP_MENU_ARRAY+=('3' ": LCD Panel addon: [${lcdpanel_text:-NONE}]")
+ local lcdpanel_text=$(sed -n '/^[[:blank:]]*CONFIG_LCDPANEL=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ G_WHIP_MENU_ARRAY+=('3' ": LCD Panel addon: [${lcdpanel_text:=none}]")
fi
@@ -232,7 +228,7 @@
# Display brightness
G_WHIP_MENU_ARRAY+=('16' ': Display Brightness')
- local xorg_dpi_current=$(grep -m1 '^[[:blank:]]*SOFTWARE_XORG_DPI=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local xorg_dpi_current=$(sed -n '/^[[:blank:]]*SOFTWARE_XORG_DPI=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
G_WHIP_MENU_ARRAY+=('17' ": X.Org DPI: [${xorg_dpi_current:-N/A}]")
(( $G_HW_MODEL != 20 )) && G_WHIP_MENU_ARRAY+=('14' ': LED Control')
@@ -241,15 +237,15 @@
if (( $G_HW_MODEL < 10 )); then
# HDMI rotation
- local rotation_hdmi_current=$(grep -m1 '^[[:blank:]]*display_hdmi_rotate=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local rotation_hdmi_current=$(sed -n '/^[[:blank:]]*display_hdmi_rotate=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
G_WHIP_MENU_ARRAY+=('4' ": Rotation (HDMI) : [${rotation_hdmi_current:=0}]")
# LCD rotation
- local rotation_lcd_current=$(grep -m1 '^[[:blank:]]*lcd_rotate=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local rotation_lcd_current=$(sed -n '/^[[:blank:]]*lcd_rotate=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
G_WHIP_MENU_ARRAY+=('5' ": Rotation (LCD) : [${rotation_lcd_current:=0}]")
# Display overscan
- local overscan_disabled=$(grep -c -m1 '^[[:blank:]]*disable_overscan=1' /DietPi/config.txt)
+ local overscan_disabled=$(grep -cm1 '^[[:blank:]]*disable_overscan=1' /DietPi/config.txt)
local overscan_text='On'
(( $overscan_disabled )) && overscan_text='Off'
G_WHIP_MENU_ARRAY+=('6' ": Overscan : [$overscan_text]")
@@ -273,18 +269,22 @@
fi
- # HDMI signal boost
- local hdmi_boost_current=$({ grep -m1 '^[[:blank:]]*config_hdmi_boost=' /DietPi/config.txt || vcgencmd get_config config_hdmi_boost; } | sed 's/^[^=]*=//')
- G_WHIP_MENU_ARRAY+=('7' ": HDMI Boost : [${hdmi_boost_current:=N/A}]")
+ # HDMI signal boost, RPi up to 3 only
+ if (( $G_HW_MODEL < 4 )); then
+
+ local hdmi_boost_current=$(grep -m1 '^[[:blank:]]*config_hdmi_boost=' /DietPi/config.txt || vcgencmd get_config config_hdmi_boost); hdmi_boost_current=${hdmi_boost_current#*=}
+ G_WHIP_MENU_ARRAY+=('7' ": HDMI Boost : [${hdmi_boost_current:=N/A}]")
+
+ fi
# RPi camera module
- local rpi_camera_module_enabled=$(grep -c -m1 '^[[:blank:]]*start_x=1' /DietPi/config.txt)
+ local rpi_camera_module_enabled=$(grep -cm1 '^[[:blank:]]*start_x=1' /DietPi/config.txt)
local rpi_camera_module_text='Off'
(( $rpi_camera_module_enabled )) && rpi_camera_module_text='On'
G_WHIP_MENU_ARRAY+=('8' ": RPi Camera : [$rpi_camera_module_text]")
# RPi camera LED
- local rpi_camera_led_disabled=$(grep -c -m1 '^[[:blank:]]*disable_camera_led=1' /DietPi/config.txt)
+ local rpi_camera_led_disabled=$(grep -cm1 '^[[:blank:]]*disable_camera_led=1' /DietPi/config.txt)
local rpi_camera_led_text='On'
(( $rpi_camera_led_disabled )) && rpi_camera_led_text='Off'
G_WHIP_MENU_ARRAY+=('9' ": RPI Camera led : [$rpi_camera_led_text]")
@@ -292,7 +292,7 @@
# JustBoom IR Remote
local justboom_ir_remote_text='Off'
local justboom_ir_remote_enabled=0
- if [[ -f /etc/systemd/system/justboom-ir-mpd.service ]]; then
+ if [[ -f '/etc/systemd/system/justboom-ir-mpd.service' ]]; then
justboom_ir_remote_text='On'
justboom_ir_remote_enabled=1
@@ -301,11 +301,11 @@
G_WHIP_MENU_ARRAY+=('11' ": JustBoom IR remote : [$justboom_ir_remote_text]")
# VC1 key
- local vc1_key_current=$(grep -m1 '^[[:blank:]]*decode_WVC1=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local vc1_key_current=$(sed -n '/^[[:blank:]]*decode_WVC1=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
G_WHIP_MENU_ARRAY+=('12' ": VC1 Key : [${vc1_key_current:=none}]")
# MPEG2 key
- local mpeg2_key_current=$(grep -m1 '^[[:blank:]]*decode_MPG2=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local mpeg2_key_current=$(sed -n '/^[[:blank:]]*decode_MPG2=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
G_WHIP_MENU_ARRAY+=('13' ": MPEG2 Key : [${mpeg2_key_current:=none}]")
fi
@@ -340,16 +340,10 @@
do
G_WHIP_DEFAULT_ITEM=${!i}
- if G_WHIP_INPUTBOX "Please enter a value (pixel count) for $i\n - EG: 16"; then
-
- G_CONFIG_INJECT "$i=" "$i=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
- REBOOT_REQUIRED=1
+ G_WHIP_INPUTBOX "Please enter a value (pixel count) for $i\n - EG: 16" || break
- else
-
- break
-
- fi
+ G_CONFIG_INJECT "$i=" "$i=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
+ REBOOT_REQUIRED=1
done
@@ -392,8 +386,7 @@
elif (( $G_WHIP_RETURNED_VALUE == 2 )); then
- if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 ||
- ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then # REMOVE v6.24
+ if (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 )); then
G_WHIP_MSG '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.'
TARGETMENUID=6
@@ -419,7 +412,7 @@
for i in "${overscan_options[@]}"
do
- G_CONFIG_INJECT "$i=" "#$i=0" /DietPi/config.txt
+ sed -i "/^[[:blank:]]*$i=/c\#$i=0" /DietPi/config.txt
done
@@ -434,14 +427,14 @@
elif (( $G_WHIP_RETURNED_VALUE == 7 )); then
- # RPi only
- if (( $G_HW_MODEL < 10 )); then
+ # RPi up to 3 only
+ if (( $G_HW_MODEL < 4 )); then
G_WHIP_MENU_ARRAY=(
'0' ': Disabled'
- '2' ': RPi 1 Default'
- '5' ': RPi 2+ Default'
+ '2' ': RPi 1 A/B Default'
+ '5' ': RPi 1+/2/3 Default'
'6' ''
'7' ': High (May increase stability)'
'8' ''
@@ -517,8 +510,8 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
/DietPi/dietpi/func/dietpi-set_hardware remoteir none
REBOOT_REQUIRED=1
- elif G_WHIP_YESNO "This will enable the IR modules, setup Lirc and the Odroid Remote for Odroid C1, C2 and XU4 Cloudshell.
-\nNB: Other remotes can be configured by running 'irrecord' and applying the codes to '/etc/lirc/lircd.conf'\n\nDo you wish to continue?"; then
+ elif G_WHIP_YESNO 'This will enable the IR modules, setup Lirc and the Odroid Remote for Odroid C1, C2 and XU4 Cloudshell.
+\nNB: Other remotes can be configured by running "irrecord" and applying the codes to "/etc/lirc/lircd.conf"\n\nDo you wish to continue?'; then
/DietPi/dietpi/func/dietpi-set_hardware remoteir odroid_remote
REBOOT_REQUIRED=1
@@ -548,7 +541,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
G_CONFIG_INJECT 'decode_WVC1=' "decode_WVC1=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
# https://github.com/MichaIng/DietPi/issues/1487
- local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem_1024' /DietPi/config.txt | sed 's/^[^=]*=//g')
+ local current_gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024/{s/^[^=]*=//p;q}' /DietPi/config.txt)
(( $current_gpu_mem < 128 )) && /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit 128
REBOOT_REQUIRED=1
@@ -563,7 +556,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
G_CONFIG_INJECT 'decode_MPG2=' "decode_MPG2=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
# https://github.com/MichaIng/DietPi/issues/1487
- local current_gpu_mem=$(grep -m1 '^[[:blank:]]*gpu_mem_1024' /DietPi/config.txt | sed 's/^[^=]*=//g')
+ local current_gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024/{s/^[^=]*=//p;q}' /DietPi/config.txt)
(( $current_gpu_mem < 128 )) && /DietPi/dietpi/func/dietpi-set_hardware gpumemsplit 128
REBOOT_REQUIRED=1
@@ -627,7 +620,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
elif (( $G_WHIP_RETURNED_VALUE == 16 )); then
- # - Known FP's for setting brightness
+ # Known FP's for setting brightness
local afp_current_set_brightness=(
'/sys/class/backlight/intel_backlight'
@@ -661,7 +654,6 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
G_WHIP_INPUTBOX "Please enter a brightness value:\n - Min = $MIN_VALUE | Max = $MAX_VALUE"
if (( $? == 0 )) && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then
- # - apply
echo $G_WHIP_RETURNED_VALUE > $fp_brightness/brightness
fi
@@ -705,10 +697,10 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
Xorg_Configure(){
- if G_WHIP_YESNO "Xorg Configuration:\nNB: This feature will only work if X server is NOT currently running.
+ if G_WHIP_YESNO 'Xorg Configuration:\nNB: This feature will only work if X server is NOT currently running.
\nPlease ensure:\n - No current X server (desktop) is running
-\nIf a desktop is running, please set 'dietpi-autostart' to 'Console', reboot system, then rerun this option.
-\nWould you like to continue?"; then
+\nIf a desktop is running, please set "dietpi-autostart" to "Console", reboot system, then rerun this option.
+\nWould you like to continue?'; then
G_RUN_CMD Xorg -configure
mv /root/xorg.conf.new /etc/X11/xorg.conf
@@ -725,7 +717,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
# VM
if (( $G_HW_MODEL == 20 )); then
- local current=$(grep -m1 '^[[:blank:]]*GRUB_GFXMODE=' /etc/default/grub | sed 's/^[^=]*=//')
+ local current=$(sed -n '/^[[:blank:]]*GRUB_GFXMODE=/{s/^[^=]*=//p;q}' /etc/default/grub)
[[ $current ]] || current='System default'
G_WHIP_MENU_ARRAY=(
@@ -829,20 +821,22 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
framebuffer_x=${framebuffer_x#*=}; framebuffer_x=${framebuffer_x:-0}
local framebuffer_y=$(grep -m1 '^[[:blank:]]*framebuffer_height=' /DietPi/config.txt || vcgencmd get_config framebuffer_height)
framebuffer_y=${framebuffer_y#*=}; framebuffer_y=${framebuffer_y:-0}
- local current_value=$(grep -m1 '^[[:blank:]]*dtoverlay=vc4-' /DietPi/config.txt | sed 's/^[^=]*=//') # OpenGL check 1st
+ local current_value=$(sed -n '/^[[:blank:]]*dtoverlay=vc4-/{s/^[^=]*=//p;q}' /DietPi/config.txt) # OpenGL check 1st
if [[ ! $current_value ]]; then
- # - FB
+ # Framebuffer
current_value="$framebuffer_x X $framebuffer_y"
- # - Check for headless
- grep -q '^[[:blank:]]*hdmi_ignore_hotplug=1' /DietPi/config.txt && grep -q '^[[:blank:]]*hdmi_ignore_composite=1' /DietPi/config.txt && current_value='Headless'
+ # Check for headless
+ grep -q '^[[:blank:]]*AUTO_SETUP_HEADLESS=1' /DietPi/dietpi.txt && current_value='Headless'
fi
- G_WHIP_MENU_ARRAY=(
+ # RPi4 doesn't support full KMS driver currently
+ (( $G_HW_MODEL == 4 )) && G_WHIP_MENU_ARRAY=() || G_WHIP_MENU_ARRAY=('vc4-kms-v3d' ': OpenGL | 1920 x 1080')
+
+ G_WHIP_MENU_ARRAY+=(
- 'vc4-kms-v3d' ': OpenGL | 1920 x 1080'
'vc4-fkms-v3d' ': OpenGL | 1920 x 1080'
'1080p' ': 1920 x 1080'
'720p' ': 1280 x 720'
@@ -867,6 +861,7 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
TARGETMENUID=2 # Return to this menu
+ # Enable headless if chosen, else always disable
if [[ $G_WHIP_RETURNED_VALUE == 'Headless' ]]; then
G_WHIP_YESNO 'Using the Headless option will:
@@ -874,12 +869,10 @@ A long (or insufficiently manufactured) cable may required a higher boost settin
- Disable the framebuffer
- Lower energy consumption by 0.1+ Watts
- Improve RAM performance by 1-5% (VideoCore shares RAM bandwidth)
- - Lead to some kernel error messages on boot, that can be ignored\n
-Re-enabling HDMI requires a reboot. If you need emergency HDMI output, comment or remove the following lines within "config.txt" on first partition of the SDcard from external system:
- - hdmi_ignore_hotplug=1
- - hdmi_ignore_composite=1\n
-More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p105008
- and here: https://github.com/raspberrypi/userland/issues/447#issuecomment-404399670' || { REBOOT_REQUIRED=0; return; }
+ Source: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p105008\n
+Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the following files on first partition of the SDcard from external system:
+ - In config.txt, set "hdmi_ignore_hotplug=0" and comment/remove all (max_)framebuffer_(width/height) lines.
+ - In dietpi.txt, set "AUTO_SETUP_HEADLESS=1".' || { REBOOT_REQUIRED=0; return; }
/DietPi/dietpi/func/dietpi-set_hardware headless 1
@@ -889,10 +882,15 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
fi
- # - Always disable composite by default
- [[ $G_WHIP_RETURNED_VALUE == 'sdtv_mode'* ]] || sed -i '/sdtv_mode=/c\#sdtv_mode=0' /DietPi/config.txt
+ # Disable composite if not chosen
+ if ! [[ $G_WHIP_RETURNED_VALUE == 'sdtv_mode'* ]]; then
+
+ sed -i '/sdtv_mode=/c\#sdtv_mode=0' /DietPi/config.txt
+ sed -i '/enable_tvout=/c\#enable_tvout=0' /DietPi/config.txt
- # - Always disable OpenGL by default
+ fi
+
+ # Disable OpenGL if not chosen
[[ $G_WHIP_RETURNED_VALUE == 'vc4-'* ]] || /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl disable
if [[ $G_WHIP_RETURNED_VALUE == 'vc4-'* ]]; then
@@ -905,7 +903,9 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
'sdtv_mode'*)
- sed -i "/sdtv_mode=/c\\$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
+ # Enable SDTV on RPi4, apply to all RPi to allow SDcard switch
+ G_CONFIG_INJECT 'enable_tvout=' 'enable_tvout=1' /DietPi/config.txt
+ G_CONFIG_INJECT 'sdtv_mode=' "$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
framebuffer_x=720
framebuffer_y=576
@@ -969,7 +969,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
esac
- # - Apply x/y
+ # Apply framebuffer size and ondemand Chromium resolution
G_CONFIG_INJECT 'framebuffer_width=' "framebuffer_width=$framebuffer_x" /DietPi/config.txt
G_CONFIG_INJECT 'framebuffer_height=' "framebuffer_height=$framebuffer_y" /DietPi/config.txt
G_CONFIG_INJECT 'SOFTWARE_CHROMIUM_RES_X=' "SOFTWARE_CHROMIUM_RES_X=$framebuffer_x" /DietPi/dietpi.txt
@@ -979,70 +979,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
fi
- # Odroid C1: REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- # Get Current Values
- local current_resolution=$(mawk -F '"' '/setenv m "/ {print $2;exit}' /DietPi/boot.ini)
-
- G_WHIP_MENU_ARRAY=(
-
- '1080p' ': 1920 x 1080'
- '720p' ': 1280 x 720'
- '480p' ': 720 x 480'
- 'VU7+' ': 1024 x 600'
- 'PC1' ': 1024 x 768'
-
- )
-
- G_WHIP_DEFAULT_ITEM=$current_resolution
- if G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $current_resolution"; then
-
- REBOOT_REQUIRED=1
-
- TARGETMENUID=2 # Return to this menu
-
- # - Always reset to HDMI
- sed -i '/setenv vout_mode /c\setenv vout_mode "hdmi"' /DietPi/boot.ini
-
- case "$G_WHIP_RETURNED_VALUE" in
-
- '1080p')
-
- sed -i '/setenv m /c\setenv m "1080p"' /DietPi/boot.ini
-
- ;;
-
- '720p')
-
- sed -i '/setenv m /c\setenv m "720p"' /DietPi/boot.ini
-
- ;;
-
- '480p')
-
- sed -i '/setenv m /c\setenv m "480p"' /DietPi/boot.ini
-
- ;;
-
- 'PC1')
-
- sed -i '/setenv m /c\setenv m "1024x768"' /DietPi/boot.ini
-
- ;;
-
- 'VU7+')
-
- sed -i '/setenv m /c\setenv m "1024x600"' /DietPi/boot.ini
- sed -i '/setenv vout_mode /c\setenv vout_mode "dvi"' /DietPi/boot.ini
-
- ;;
-
- esac
-
- fi
-
- # Odroid XU3/4
+ # Odroid XU3/XU4/HC1/HC2
elif (( $G_HW_MODEL == 11 )); then
# Get Current Values
@@ -1077,7 +1014,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
TARGETMENUID=2 # Return to this menu
- # - Always reset to hdmi
+ # Always reset to HDMI
sed -i '/setenv vout /c\setenv vout "hdmi"' /DietPi/boot.ini
if [[ $G_WHIP_RETURNED_VALUE == '1024x600' ]]; then
@@ -1121,8 +1058,8 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
[[ $current_resolution != $G_WHIP_RETURNED_VALUE ]] && REBOOT_REQUIRED=1
# Always reset vga/dvi options
- sed -i '/setenv vout "dvi"/c\# setenv vout "dvi"' /DietPi/boot.ini
- sed -i '/setenv vout "vga"/c\# setenv vout "vga"' /DietPi/boot.ini
+ sed -i '/^[[:blank:]]*setenv vout "dvi"/c\#setenv vout "dvi"' /DietPi/boot.ini
+ sed -i '/^[[:blank:]]*setenv vout "vga"/c\#setenv vout "vga"' /DietPi/boot.ini
# DVI / VU7+
if [[ $G_WHIP_RETURNED_VALUE == '1024x600p 60hz' ]]; then
@@ -1145,7 +1082,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
elif (( $G_HW_MODEL == 40 )); then
# Get Current Values
- local current_resolution=$(grep -m1 '^[[:blank:]]*hdmi_mode=' /DietPi/uEnv.txt | sed 's/^[^=]*=//')
+ local current_resolution=$(sed -n '/^[[:blank:]]*hdmi_mode=/{s/^[^=]*=//p;q}' /DietPi/uEnv.txt)
[[ $current_resolution ]] || current_resolution='Not set'
G_WHIP_MENU_ARRAY=(
@@ -1229,7 +1166,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
local item=$G_WHIP_RETURNED_VALUE
G_WHIP_MENU_ARRAY=(
- 'To disk' ": Move $item to disk"
+ 'To disk' ": Move $item to disk (default)"
'To RAM' ": Move $item to RAM"
)
@@ -1244,7 +1181,7 @@ More info here: https://www.raspberrypi.org/forums/viewtopic.php?p=105008#p10500
[[ $option == 'RAM' ]] && G_WHIP_MSG '[ INFO ] APT lists have been moved to RAM.\n
NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before APT installs/upgrades can be done.
- DietPi-Update and DietPi-Software will however do this automatically.'
+ DietPi scripts however will do this automatically on demand.'
G_AGUP
fi
@@ -1336,7 +1273,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before
# Swap file
local swap_size=$(free -m | mawk '/Swap:/ {print $2;exit}')
- local swap_location=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local swap_location=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
local swap_size_text="$swap_size MB"
(( $swap_size )) || swap_size_text='Off'
G_WHIP_MENU_ARRAY=('Swapfile' ": [$swap_size_text | $swap_location]")
@@ -1345,7 +1282,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before
G_WHIP_MENU_ARRAY+=('APT cache' ': Manage APT cache/info storage')
# Time sync
- local ntpd_mode_current=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local ntpd_mode_current=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
local ntpd_mode_text=''
if (( $ntpd_mode_current == 0 )); then
@@ -1390,7 +1327,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before
local bluetooth_state_text='On'
local bluetooth_state=1
- if [[ -f '/etc/modprobe.d/disable_bt.conf' ]]; then
+ if [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]]; then
bluetooth_state=0
bluetooth_state_text='Off'
@@ -1404,30 +1341,30 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before
if (( $G_HW_MODEL < 10 )); then
# I2C state
- local rpi_i2c_enabled=$(grep -c -m1 '^[[:blank:]]*dtparam=i2c_arm=on' /DietPi/config.txt)
+ local rpi_i2c_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=i2c_arm=on' /DietPi/config.txt)
local rpi_i2c_text='Off'
(( $rpi_i2c_enabled )) && rpi_i2c_text='On'
G_WHIP_MENU_ARRAY+=('I2C state' ": [$rpi_i2c_text]")
# I2C baudrate
- local rpi_i2cbaudrate_hz=$(grep -m1 '^[[:blank:]]*i2c_arm_baudrate=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local rpi_i2c_baudrate=$(sed -n '/^[[:blank:]]*dtparam=i2c_arm_baudrate=/{s/^.*=//p;q}' /DietPi/config.txt)
# - Allow commented/non-existent entry, using default value: https://github.com/raspberrypi/firmware/blob/d69aadedb7c146ba5d3b0b45a661e5669a9141c4/boot/overlays/README#L115-L116
- rpi_i2cbaudrate_hz="$(( ${rpi_i2cbaudrate_hz:-100000} / 1000 )) kHz"
- G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2cbaudrate_hz]")
+ rpi_i2c_baudrate=$(( ${rpi_i2c_baudrate:-100000} / 1000 ))
+ G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2c_baudrate kHz]")
# USB max current
- local usb_max_current_enabled=$(grep -c -m1 '^[[:blank:]]*max_usb_current=1' /DietPi/config.txt)
- local rpi_usbmaxcurrent_text='Off'
- (( $usb_max_current_enabled )) && rpi_usbmaxcurrent_text='On'
- G_WHIP_MENU_ARRAY+=('Max USB current' ": [$rpi_usbmaxcurrent_text]")
+ local rpi_max_usb_current_enabled=$(grep -cm1 '^[[:blank:]]*max_usb_current=1' /DietPi/config.txt)
+ local rpi_max_usb_current_text='Off'
+ (( $rpi_max_usb_current_enabled )) && rpi_max_usb_current_text='On'
+ G_WHIP_MENU_ARRAY+=('Max USB current' ": [$rpi_max_usb_current_text]")
# USB boot option: RPi3 only and not required for RPi3+: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_DESCRIPTION != *'+'* ]]; then
- local rpi3_usb_boot_bit_enabled=$(vcgencmd otp_dump | grep -m1 -ci '17:3020000a')
- local rpi3_usb_boot_bit_enabled_text='Off'
- (( $rpi3_usb_boot_bit_enabled )) && rpi3_usb_boot_bit_enabled_text='On'
- G_WHIP_MENU_ARRAY+=('USB boot support' ": [$rpi3_usb_boot_bit_enabled_text]")
+ local rpi3_usb_boot_bit_enabled=$(vcgencmd otp_dump | grep -cm1 '17:3020000a')
+ local rpi3_usb_boot_bit_text='Off'
+ (( $rpi3_usb_boot_bit_enabled )) && rpi3_usb_boot_bit_text='On'
+ G_WHIP_MENU_ARRAY+=('USB boot support' ": [$rpi3_usb_boot_bit_text]")
fi
@@ -1454,8 +1391,8 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before
G_WHIP_MENU_ARRAY=(
- 'Emulated' 'Use "fake-hwclock" to apply system clock on early boot'
- 'Hardware' 'Device has an active hardware RTC, purge "fake-hwclock"'
+ 'Emulated' ': Use "fake-hwclock" to apply system clock on early boot'
+ 'Hardware' ': Device has an active hardware RTC, purge "fake-hwclock"'
)
@@ -1497,14 +1434,15 @@ Please choose whether your device have an active RTC or requires "fake-hwclock":
)
G_WHIP_DEFAULT_ITEM=$ntpd_mode_current
- G_WHIP_MENU 'Here you can adjust the frequency of network time syncs.\n
+ if G_WHIP_MENU 'Here you can adjust the frequency of network time syncs.\n
- Modes 1-3:\nDietPi will launch systemd-timesyncd as a program, rather than a daemon. Once the time has been updated on your system, timesyncd will exit to reduce resource usage.\n
- Mode 4:\nsystemd-timesyncd will run as a background daemon/service. Differences in time will be gradually adjusted over time, rather than instantly.\n
- - Mode 0:\nIf you use a custom time sync method, e.g. the NTP package for high precision demand, select custom mode to avoid systemd-timesyncd interference.'
- if (( $? == 0 )); then
+ - Mode 0:\nIf you use a custom time sync method, e.g. the NTP package for high precision demand, select custom mode to avoid systemd-timesyncd interference.'; then
/DietPi/dietpi/func/dietpi-set_software ntpd-mode $G_WHIP_RETURNED_VALUE
- /DietPi/dietpi/func/run_ntpd 1
+ # Run time sync only, if not currently running, to avoid concurrent execution if dietpi-config was called from DietPi-Run_NTPD error handler
+ # - Run non-interactively to avoid its internal error handler allowing to open a concurrent dietpi-config instance
+ pgrep -cif /dietpi/func/run_ntpd &> /dev/null || G_INTERACTIVE=0 MAX_LOOPS_CHECK=10 /DietPi/dietpi/func/run_ntpd 1
fi
@@ -1538,27 +1476,21 @@ Please choose whether your device have an active RTC or requires "fake-hwclock":
elif [[ $G_WHIP_RETURNED_VALUE == 'Max USB current' ]]; then
- # Enabled
- if (( $usb_max_current_enabled == 1 )); then
+ if (( $rpi_max_usb_current_enabled )); then
- if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_text (1.2AMP)\nWould you like to disable this setting?
+ if G_WHIP_YESNO "Current setting: [$rpi_max_usb_current_text] (1.2AMP)\nWould you like to disable this setting?
\nOnce Disabled:\n - Max USB current will be limited to 0.6AMP.\n - Shared by all USB ports."; then
- sed -i '/max_usb_current=/c\max_usb_current=0' /DietPi/config.txt
+ G_CONFIG_INJECT 'max_usb_current=' 'max_usb_current=0' /DietPi/config.txt
REBOOT_REQUIRED=1
fi
- # Disabled
- elif (( $usb_max_current_enabled == 0 )); then
-
- if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_text (0.6AMP)\nWould you like to enable this setting?
+ elif G_WHIP_YESNO "Current setting: [$rpi_max_usb_current_text] (0.6AMP)\nWould you like to enable this setting?
\nOnce Enabled:\n - Max USB current will be set to 1.2AMP.\n - Shared by all USB ports."; then
- sed -i '/max_usb_current=/c\max_usb_current=1' /DietPi/config.txt
- REBOOT_REQUIRED=1
-
- fi
+ G_CONFIG_INJECT 'max_usb_current=' 'max_usb_current=1' /DietPi/config.txt
+ REBOOT_REQUIRED=1
fi
@@ -1578,10 +1510,10 @@ Please choose whether your device have an active RTC or requires "fake-hwclock":
elif [[ $G_WHIP_RETURNED_VALUE == 'I2C frequency' ]]; then
# Remove kHz from current
- G_WHIP_DEFAULT_ITEM=${rpi_i2cbaudrate_hz% kHz}
+ G_WHIP_DEFAULT_ITEM=$rpi_i2c_baudrate
if G_WHIP_INPUTBOX 'Please enter the required I2C baudrate frequency (kHz).' && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" 0; then
- /DietPi/dietpi/func/dietpi-set_hardware i2c "$G_WHIP_RETURNED_VALUE"
+ /DietPi/dietpi/func/dietpi-set_hardware i2c $G_WHIP_RETURNED_VALUE
REBOOT_REQUIRED=1
fi
@@ -1602,25 +1534,18 @@ Please choose whether your device have an active RTC or requires "fake-hwclock":
fi
- elif [[ $G_WHIP_RETURNED_VALUE == 'USB boot support' ]]; then
-
- if (( ! $rpi3_usb_boot_bit_enabled )); then
-
- if G_WHIP_YESNO 'The following will enable the RPi 3 to boot from USB mass storage devices. A hardware bit "17:3020000a", specific to the device is set to enable the feature.
+ elif [[ $G_WHIP_RETURNED_VALUE == 'USB boot support' && $rpi3_usb_boot_bit_enabled == 0 ]] &&
+ G_WHIP_YESNO 'The following will enable the RPi 3 to boot from USB mass storage devices. A hardware bit "17:3020000a", specific to the device is set to enable the feature.
\nNB:\n - Not all USB mass storage devices are supported\n - The HW bit which enables this setting is non-reversible
\nDo you wish to enable USB mass storage boot support?'; then
- /DietPi/dietpi/func/dietpi-set_hardware rpi3_usb_boot enable
- REBOOT_REQUIRED=1
+ /DietPi/dietpi/func/dietpi-set_hardware rpi3_usb_boot enable
+ REBOOT_REQUIRED=1
- # Reboot now?
- G_WHIP_YESNO 'A reboot is required to apply this setting.\n
+ # Reboot now?
+ G_WHIP_YESNO 'A reboot is required to apply this setting.\n
Please reboot this system once, the HW bit which allows USB boot support will then be set. After which, USB mass storage devices can be used for booting.\n\nWould you like to reboot the system now?' && reboot
- fi
-
- fi
-
fi
fi
@@ -1633,7 +1558,7 @@ Please reboot this system once, the HW bit which allows USB boot support will th
TARGETMENUID=0
# All devices
- local current_cpu_governor=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_GOVERNOR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local current_cpu_governor=$(sed -n '/^[[:blank:]]*CONFIG_CPU_GOVERNOR=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
local frequency_min_cpu_governor=1
local fp_frequency_min_cpu_governor='/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq'
@@ -1671,7 +1596,7 @@ Please reboot this system once, the HW bit which allows USB boot support will th
$current_cpu_governor == 'conservative' ||
$current_cpu_governor == 'interactive' ]]; then
- local current_cpu_throttle_up=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_USAGE_THROTTLE_UP=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local current_cpu_throttle_up=$(sed -n '/^[[:blank:]]*CONFIG_CPU_USAGE_THROTTLE_UP=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
G_WHIP_MENU_ARRAY+=('CPU Throttle Up' ": [${current_cpu_throttle_up}%]")
fi
@@ -1679,10 +1604,10 @@ Please reboot this system once, the HW bit which allows USB boot support will th
# Ondemand extras
if [[ $current_cpu_governor == 'ondemand' ]]; then
- local current_cpu_sample_rate=$(( $(grep -m1 '^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' /DietPi/dietpi.txt | sed 's/[^=]*=//') / 1000 )) #convert to ms
+ local current_cpu_sample_rate=$(( $(sed -n '/^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_RATE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) / 1000 )) # Convert to ms
G_WHIP_MENU_ARRAY+=('Ondemand Sample Rate' ": [${current_cpu_sample_rate}ms]")
- local current_cpu_down_factor=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' /DietPi/dietpi.txt | sed 's/[^=]*=//')
+ local current_cpu_down_factor=$(sed -n '/^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
local current_cpu_down_factor_ms=$(( $current_cpu_down_factor * $current_cpu_sample_rate ))
G_WHIP_MENU_ARRAY+=('Ondemand Down Factor' ": [$current_cpu_down_factor (${current_cpu_down_factor_ms}ms)]")
@@ -1693,39 +1618,46 @@ Please reboot this system once, the HW bit which allows USB boot support will th
local intel_boost_text='Enabled'
if grep -qi 'genuineintel' /proc/cpuinfo; then
- intel_boost_disabled=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_DISABLE_TURBO=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ intel_boost_disabled=$(sed -n '/^[[:blank:]]*CONFIG_CPU_DISABLE_TURBO=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
(( $intel_boost_disabled )) && intel_boost_text='Disabled'
G_WHIP_MENU_ARRAY+=('Intel Turbo/Boost' ": [$intel_boost_text]")
fi
# Define CPU scaling frequency or percent
- local type_cpu_freq_info='MHz'
- # - Intel
- [[ -f /sys/devices/system/cpu/intel_pstate/max_perf_pct ]] && type_cpu_freq_info='%'
+ # - Disable on RPi since ondemand only jumps between lowest and highest by default. RPi user hence should use "ARM Idle Frequency" option + overclocking to set those two freqs.
+ if (( $G_HW_MODEL > 9 )); then
+
+ local type_cpu_freq_info='MHz'
+ # Intel
+ [[ -f '/sys/devices/system/cpu/intel_pstate/max_perf_pct' ]] && type_cpu_freq_info='%'
+
+ # User Scaling Max Freq limit
+ local user_frequency_max_current=$(sed -n '/^[[:blank:]]*CONFIG_CPU_MAX_FREQ=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local user_frequency_max_text="$user_frequency_max_current $type_cpu_freq_info"
+ (( $user_frequency_max_current )) || user_frequency_max_text='Off'
- # - User Scaling Max Freq limit.
- local user_frequency_max_current=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_MAX_FREQ=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local user_frequency_max_text="$user_frequency_max_current $type_cpu_freq_info"
- (( $user_frequency_max_current )) || user_frequency_max_text='Off'
+ # User Scaling Min Freq limit
+ local user_frequency_min_current=$(sed -n '/^[[:blank:]]*CONFIG_CPU_MIN_FREQ=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local user_frequency_min_text="$user_frequency_min_current $type_cpu_freq_info"
+ (( $user_frequency_min_current )) || user_frequency_min_text='Off'
- # - User Scaling Min Freq limit.
- local user_frequency_min_current=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_MIN_FREQ=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local user_frequency_min_text="$user_frequency_min_current $type_cpu_freq_info"
- (( $user_frequency_min_current )) || user_frequency_min_text='Off'
+ G_WHIP_MENU_ARRAY+=('CPU Frequency Limits' ": Max = [$user_frequency_max_text] | Min = [$user_frequency_min_text]")
- G_WHIP_MENU_ARRAY+=('CPU Frequency Limits' ": Max = [$user_frequency_max_text] | Min = [$user_frequency_min_text]")
+ fi
# RPi extras
if (( $G_HW_MODEL < 10 )); then
- local current_cpu_temp_limit=$(grep -m1 'temp_limit' /DietPi/config.txt | sed 's/^[^=]*=//')
- G_WHIP_MENU_ARRAY+=('ARM Temp Limit ' ": [${current_cpu_temp_limit}'c]")
+ local temp_limit=$(sed -n '/^[[:blank:]]*temp_limit=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
+ G_WHIP_MENU_ARRAY+=('ARM Temp Limit' ": [${temp_limit:=85}'c]")
+
+ local arm_freq_min=$(sed -n '/^[[:blank:]]*arm_freq_min=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
+ [[ $arm_freq_min ]] || { [[ G_HW_MODEL == [01] ]] && arm_freq_min=700 || arm_freq_min=600; } # 700 on RPi1+Zero, 600 on all others
+ G_WHIP_MENU_ARRAY+=('ARM Idle Frequency' ": [$arm_freq_min MHz]")
- # Disabled due to https://github.com/MichaIng/DietPi/issues/73
- #G_WHIP_MENU_ARRAY+=("Lower Idle Frequencies" ": $rpi_freq_min_text")
- # initial_turbo disabled due to: https://github.com/MichaIng/DietPi/issues/1836
- #G_WHIP_MENU_ARRAY+=('ARM Initial Turbo' ": $text_current_initial_turbo")
+ local initial_turbo=$(sed -n '/^[[:blank:]]*initial_turbo=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
+ G_WHIP_MENU_ARRAY+=('ARM Initial Turbo' ": [${initial_turbo:=0} seconds]")
fi
@@ -1735,16 +1667,15 @@ Please reboot this system once, the HW bit which allows USB boot support will th
case "$G_WHIP_RETURNED_VALUE" in
- 'Intel Turbo/Boost'*)
+ 'Intel Turbo/Boost')
- (( intel_boost_disabled++ ))
- (( $intel_boost_disabled > 1 )) && intel_boost_disabled=0
+ (( $intel_boost_disabled )) && intel_boost_disabled=0 || intel_boost_disabled=1
G_CONFIG_INJECT 'CONFIG_CPU_DISABLE_TURBO=' "CONFIG_CPU_DISABLE_TURBO=$intel_boost_disabled" /DietPi/dietpi.txt
/DietPi/dietpi/func/dietpi-set_cpu
;;
- 'Ondemand Down Factor'*)
+ 'Ondemand Down Factor')
MIN_VALUE=1
MAX_VALUE=200
@@ -1759,7 +1690,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will
;;
- 'Ondemand Sample Rate'*)
+ 'Ondemand Sample Rate')
local file=''
local afile=(
@@ -1801,7 +1732,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will
;;
- 'CPU Frequency Limits'*)
+ 'CPU Frequency Limits')
/DietPi/dietpi/dietpi-cpuinfo 2
@@ -1813,8 +1744,8 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will
local available_frequency_array=()
readarray available_frequency_array < /tmp/dietpi-available_cpu_freqs
- local division_factor=1000 #display MHz for user menu
- # - Intel (disable conversion)
+ local division_factor=1000 # display MHz for user menu
+ # Intel (disable conversion)
[[ -f '/sys/devices/system/cpu/intel_pstate/max_perf_pct' ]] && division_factor=1
local index=0 # 0=max | 1=min
@@ -1859,20 +1790,20 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
;;
- 'Overclocking'*)
+ 'Overclocking')
TARGETMENUID=13
;;
- 'CPU Governor'*)
+ 'CPU Governor')
- # - Scaling govs not available (No Gavnor!)
+ # Scaling govs not available (No Gavnor!)
if [[ ! -f $FP_CPU_SCALING_GOV ]]; then
G_WHIP_MSG 'Your processor, or kernel, does not support this feature.\n\n(Info): scaling_available_governors does not exist.'
- # - Obtain available Govs. Setup their menu and description. (Yes Gavnor!)
+ # Obtain available Govs. Setup their menu and description. (Yes Gavnor!)
else
local Description='CPU Governor:'
@@ -1925,7 +1856,7 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
;;
- 'CPU Throttle Up'*)
+ 'CPU Throttle Up')
MIN_VALUE=30
MAX_VALUE=95
@@ -1940,15 +1871,15 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
;;
- 'ARM Temp Limit'*)
+ 'ARM Temp Limit')
MIN_VALUE=45
MAX_VALUE=85
- G_WHIP_DEFAULT_ITEM=$current_cpu_temp_limit
+ G_WHIP_DEFAULT_ITEM=$temp_limit
if G_WHIP_INPUTBOX "When the ARM temperature ('c) reaches this value, the ARM will underclock to reduce heat.
- Recommended value: 65\n - Valid range: $MIN_VALUE - $MAX_VALUE" && G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then
- (( $G_WHIP_RETURNED_VALUE > 65 )) && G_WHIP_MSG "Higher operating temperatures will reduce the life of your ARM SoC. Heat also dissipates through the PCB into other components, decreasing the lifespan of the whole device. Use at your own risk.\n\nDietPi recommends 65'c as a safe value (75'c for RPi 3).\n\nMore info: https://github.com/MichaIng/DietPi/issues/356"
+ (( $G_WHIP_RETURNED_VALUE > 65 )) && G_WHIP_MSG "Higher operating temperatures will reduce the life of your ARM SoC. Heat also dissipates through the PCB into other components, decreasing the lifespan of the whole device. Use at your own risk.\n\nDietPi recommends 65'c as a safe value (75'c for RPi 3/4).\n\nMore info: https://github.com/MichaIng/DietPi/issues/356"
G_CONFIG_INJECT 'temp_limit=' "temp_limit=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
REBOOT_REQUIRED=1
@@ -1957,6 +1888,52 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
;;
+ 'ARM Idle Frequency')
+
+ MIN_VALUE=100
+ MAX_VALUE=600
+ G_WHIP_DEFAULT_ITEM=$arm_freq_min
+ if G_WHIP_INPUTBOX "ARM frequency (MHz) used by CPU governors powersave and conservative/ondemand/interactive when on idle.
+ - Recommended value: 300\n - Valid range: $MIN_VALUE - $MAX_VALUE\n - Setting a value outside of range will reset to RPi defaults."; then
+
+ if disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then
+
+ G_CONFIG_INJECT 'arm_freq_min=' "arm_freq_min=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
+
+ else
+
+ sed -i '/^[[:blank:]]*arm_freq_min=/c\#arm_freq_min=600' /DietPi/config.txt
+
+ fi
+ REBOOT_REQUIRED=1
+
+ fi
+
+ ;;
+
+ 'ARM Initial Turbo')
+
+ MIN_VALUE=1
+ MAX_VALUE=100
+ G_WHIP_DEFAULT_ITEM=$initial_turbo
+ if G_WHIP_INPUTBOX "Amount of seconds on boot, where the CPU runs at highest clock, before it starts to respect the CPU governor. This reduces boot time quite much since RPi boots with powersave governor until the chosen one is applied at later boot stage.
+ - Recommended value: 20\n - Valid range: $MIN_VALUE - $MAX_VALUE\n - Setting a value outside of range will disable this feature."; then
+
+ if disable_error=1 G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" $MIN_VALUE $MAX_VALUE; then
+
+ G_CONFIG_INJECT 'initial_turbo=' "initial_turbo=$G_WHIP_RETURNED_VALUE" /DietPi/config.txt
+
+ else
+
+ sed -i '/^[[:blank:]]*initial_turbo=/c\#initial_turbo=20' /DietPi/config.txt
+
+ fi
+ REBOOT_REQUIRED=1
+
+ fi
+
+ ;;
+
esac
fi
@@ -2026,14 +2003,10 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
if (( $G_HW_MODEL < 10 )); then
- local ram_mem_total=$(grep -m1 '^HW_MEMORY_SIZE=' /DietPi/dietpi/.hw_model | sed 's/^[^=]*=//')
- gpu_mem_current=$(grep -m1 '^[[:blank:]]*gpu_mem_1024=' /DietPi/config.txt | sed 's/^[^=]*=//')
+ local ram_mem_total=$(sed -n '/^[[:blank:]]*HW_MEMORY_SIZE=/{s/^[^=]*=//p;q}' /DietPi/dietpi/.hw_model)
+ gpu_mem_current=$(sed -n '/^[[:blank:]]*gpu_mem_1024=/{s/^[^=]*=//p;q}' /DietPi/config.txt)
ram_mem_current=$((ram_mem_total-gpu_mem_current))
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then # REMOVE v6.24
-
- gpu_mem_current=$((1024-ram_mem_current))
-
elif (( $G_HW_MODEL == 12 )); then
gpu_mem_current=$((2048-ram_mem_current))
@@ -2077,70 +2050,18 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
fi
- # Odroid C1: REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- # Odroid HDMI/headless extra data
- local display_output_enabled=$(grep -ci -m1 '^setenv hdmioutput "1"' /DietPi/boot.ini)
- local display_vpu_enabled=$(grep -ci -m1 '^setenv vpu "1"' /DietPi/boot.ini)
- local display_output_text='On'
- local display_vpu_text='On'
-
- (( $display_output_enabled )) || display_output_text='Off'
- (( $display_vpu_enabled )) || display_vpu_text='Off'
-
- G_WHIP_MENU_ARRAY=(
-
- 'Headless' 'HDMI: Disabled | VPU: Disabled'
- 'Server' 'HDMI: Enabled | VPU: Disabled'
- 'Desktop' 'HDMI: Enabled | VPU: Enabled'
-
- )
-
- G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent : HDMI: [$display_output_text] | VPU: [$display_vpu_text]\nMemory : $gpu_mem_current MB GPU | $ram_mem_current MB RAM\nNB: GPU/RAM figures require a reboot after a change is made."
- if (( $? == 0 )); then
-
- REBOOT_REQUIRED=1
-
- TARGETMENUID=6 # Return to this menu
-
- case "$G_WHIP_RETURNED_VALUE" in
-
- 'Headless')
-
- /DietPi/dietpi/func/dietpi-set_hardware headless 1
-
- ;;
-
- 'Server')
-
- /DietPi/dietpi/func/dietpi-set_hardware headless 0
- G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini
-
- ;;
-
- 'Desktop')
-
- /DietPi/dietpi/func/dietpi-set_hardware headless 0
-
- ;;
-
- esac
-
- fi
-
# Odroid C2
elif (( $G_HW_MODEL == 12 )); then
# Odroid HDMI/headless extra data
- local display_output_enabled=$(grep -ci -m1 '^setenv nographics "0"' /DietPi/boot.ini)
+ local display_output_enabled=$(grep -cim1 '^[[:blank:]]*setenv nographics "0"' /DietPi/boot.ini)
local display_output_text='On'
(( $display_output_enabled )) || display_output_text='Off'
G_WHIP_MENU_ARRAY=(
- 'Headless' 'HDMI: Disabled | VPU: Disabled | +300MB RAM'
- 'Default' 'HDMI: Enabled | VPU: Enabled | -300MB RAM'
+ 'Headless' ': HDMI: Disabled | VPU: Disabled | +300MB RAM'
+ 'Default' ': HDMI: Enabled | VPU: Enabled | -300MB RAM'
)
@@ -2180,49 +2101,37 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
# TARGETMENUID=7
Menu_LanguageOptions(){
- TARGETMENUID=0
-
- local locale_current=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOCALE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local locale_current=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOCALE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
G_WHIP_MENU_ARRAY=(
'Locale' ": [$locale_current]"
'Timezone' ": [$( /tmp/available_locale
G_WHIP_MENU_ARRAY=()
- local index=0
- # convert for whiptail 0-1=1st option 2-3=2nd
- while read line
+ while read -r line
do
- G_WHIP_MENU_ARRAY[$index]=$line
- ((index++))
- G_WHIP_MENU_ARRAY[$index]=''
- ((index++))
+ G_WHIP_MENU_ARRAY+=("$line" '')
- done < /tmp/available_locale
- rm /tmp/available_locale
+ done <<< "$(mawk '/UTF-8/{print $1}' /usr/share/i18n/SUPPORTED)"
G_WHIP_DEFAULT_ITEM=$locale_current
if G_WHIP_MENU 'Please select a system locale. DietPi will automatically apply this as the default locale:'; then
/DietPi/dietpi/func/dietpi-set_software locale "$G_WHIP_RETURNED_VALUE"
+ REBOOT_REQUIRED=1
fi
@@ -2230,31 +2139,32 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
'Timezone')
- REBOOT_REQUIRED=1
dpkg-reconfigure tzdata
;;
'Keyboard')
- REBOOT_REQUIRED=1
-
G_WHIP_MSG 'NB: A keyboard must be physically plugged into the system, before its configuration can be changed.\n\nIf a keyboard is plugged in, please ignore this message. If not, plug one in ;)'
dpkg-reconfigure keyboard-configuration
- invoke-rc.d keyboard-setup start
+ setupcon --save # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818065
- ;;
+ ;;
esac
+ else
+
+ TARGETMENUID=0 # Return to main menu
+
fi
}
NET_RX_BYTE=0
NET_TX_BYTE=0
- NET_RX_MB='Unknown'
- NET_TX_MB='Unknown'
+ NET_RX_MB='N/A'
+ NET_TX_MB='N/A'
# $1 = device+index
Net_Update_UsageStats(){
@@ -2266,23 +2176,13 @@ Current setting: $user_frequency_min_text" && G_CONFIG_INJECT 'CONFIG_CPU_MIN_FR
NET_RX_MB='N/A'
NET_TX_MB='N/A'
- if [[ -f /sys/class/net/$input/statistics/rx_bytes && -f /sys/class/net/$input/statistics/tx_bytes ]]; then
+ if [[ -f '/sys/class/net/$input/statistics/rx_bytes' && -f '/sys/class/net/$input/statistics/tx_bytes' ]]; then
NET_RX_BYTE=$( /dev/null && WIFI_SSID_CURRENT=$(iwgetid -r)
- [[ ! $WIFI_SSID_CURRENT ]] && WIFI_SSID_CURRENT='Disconnected / No SSID'
- WIFI_CRED_INDEX=0 # Which index of SSID/KEY etc we are editing
+ [[ $WIFI_SSID_CURRENT ]] || WIFI_SSID_CURRENT='Disconnected / No SSID'
# Get extra WiFi stats
WIFI_BITRATE=0
WIFI_SIGNALSTRENGTH=0
# - Hotspot enabled?
WIFI_HOTSPOT=0
- [[ -f /usr/sbin/hostapd ]] && WIFI_HOTSPOT=1
+ [[ -f '/usr/sbin/hostapd' ]] && WIFI_HOTSPOT=1
WIFI_COUNTRYCODE='GB'
# - Prevent "nl80211 not found" message, when running this command with cfg80211 module disabled.
@@ -2777,7 +2666,7 @@ _EOF_
# Convert CIDR integer to net mask, e.g. "192.168.0.100/24" (take "24") to "255.255.255.0"
cidr2mask() {
- local i mask=''
+ local i mask
local full_octets=$(( $1 / 8 ))
local partial_octet=$(( $1%8 ))
@@ -2926,12 +2815,12 @@ _EOF_
G_WHIP_MENU_ARRAY+=('Ethernet' ": $eth_hardware_text | [$eth_disabled_text] | $eth_connected_text")
G_WHIP_MENU_ARRAY+=('WiFi' ": $wlan_hardware_text | [$wlan_disabled_text] | $wlan_connected_text")
- # - Onboard WiFi
- # RPi 3/Zero W
+ # Onboard WiFi
+ # - RPi 3/4/Zero W
if (( $HW_ONBOARD_WIFI )); then
local onboard_wifi_enabled=1
- if [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]]; then
+ if grep -q '^[[:blank:]]*dtoverlay=disable-wifi' /DietPi/config.txt; then
onboard_wifi_enabled=0
G_WHIP_MENU_ARRAY+=('Onboard WiFi' ': [Off]')
@@ -2947,11 +2836,10 @@ _EOF_
G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ')
# IPv6
- local ipv6_status_text='[WARNING] Not supported or disabled on kernel level!'
if [[ -d '/proc/sys/net/ipv6' ]]; then
local ipv6_enabled=0
- ipv6_status_text='Off'
+ local ipv6_status_text='Off'
if [[ $(ip -6 a) ]]; then
ipv6_enabled=1
@@ -2964,7 +2852,7 @@ _EOF_
local ipv4_preferred=0
local ipv4_status_text='Off'
- if [[ -f /etc/apt/apt.conf.d/99-dietpi-force-ipv4 ]]; then
+ if [[ -f '/etc/apt/apt.conf.d/99-dietpi-force-ipv4' ]]; then
ipv4_preferred=1
ipv4_status_text='On'
@@ -2992,11 +2880,10 @@ _EOF_
else
/DietPi/dietpi/func/dietpi-set_hardware wifimodules onboard_enable
+ G_WHIP_MSG '[ INFO ] Onboard WiFi enabled\n\nNB: A reboot is required for the change to take effect.'
fi
- G_WHIP_MSG 'Onboard WiFi modules setting applied\n\nNB: A reboot is required for the changes to take effect.'
-
;;
'IPv6')
@@ -3139,17 +3026,13 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
TARGETMENUID=8
- # - Get current Mode details
- local mode_current='DHCP'
- (( $ETH_MODE == 0 )) && mode_current='STATIC'
-
- # - Target Details
- local mode_target='DHCP'
- (( $ETH_MODE_TARGET == 0 )) && mode_target='STATIC'
+ # - Mode
+ local mode_text='DHCP'
+ (( $ETH_MODE_TARGET == 0 )) && mode_text='STATIC'
G_WHIP_MENU_ARRAY=('' '●─ DHCP/STATIC IP ')
- G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_target]")
+ G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_text]")
# - show static options
if (( $ETH_MODE_TARGET == 0 )); then
@@ -3188,8 +3071,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
'Disable')
- G_WHIP_YESNO 'Would you like to disable the Ethernet adapter?\n - (NOTICE) All Ethernet connections will be dropped.'
- if (( $? == 0 )); then
+ if G_WHIP_YESNO 'Would you like to disable the Ethernet adapter?\n - (NOTICE) All Ethernet connections will be dropped.'; then
ETH_DISABLED=1
Network_ApplyChanges
@@ -3245,28 +3127,17 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
HOTSPOT_CHANNEL=''
HOTSPOT_KEY=''
- WiFi_Monitor_Disable(){
-
- systemctl stop dietpi-wifi-monitor
- systemctl disable dietpi-wifi-monitor
+ WiFi_Monitor_Disable(){ systemctl disable --now dietpi-wifi-monitor; }
- }
-
- WiFi_Monitor_Enable(){
-
- systemctl enable dietpi-wifi-monitor
- G_RUN_CMD systemctl start dietpi-wifi-monitor
-
- }
+ WiFi_Monitor_Enable(){ G_RUN_CMD systemctl enable --now dietpi-wifi-monitor; }
# TARGETMENUID=10
Menu_NetworkAdapters_Wifi(){
TARGETMENUID=8
- Net_Update_UsageStats wlan$ETH_DEV_INDEX
+ Net_Update_UsageStats wlan$WIFI_DEV_INDEX
- local whip_options_total=0
local description_text="WiFi Details:\nUsage : Sent = $NET_TX_MB | Recieved = $NET_RX_MB\n"
G_WHIP_MENU_ARRAY=('' '●─ Basic Options ')
@@ -3314,13 +3185,9 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
# WiFi Menu
else
- # - Get current Mode details
- local mode_current='DHCP'
- (( $WIFI_MODE )) || mode_current='STATIC'
-
- # - Target Details
- local mode_target='DHCP'
- (( $WIFI_MODE_TARGET )) || mode_target='STATIC'
+ # - Mode
+ local mode_text='DHCP'
+ (( $WIFI_MODE_TARGET )) || mode_text='STATIC'
G_WHIP_MENU_ARRAY+=('Scan' ': Scan and configure SSID')
@@ -3340,7 +3207,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
fi
G_WHIP_MENU_ARRAY+=('' '●─ DHCP/STATIC IP ')
- G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_target]")
+ G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_text]")
# - show static options
if (( $WIFI_MODE_TARGET == 0 )); then
@@ -3422,7 +3289,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
'Channel')
- #2.4ghz only atm
+ # 2.4ghz only atm
local channel_mhz=2412
local channel_min=1
local channel_max=13
@@ -3442,14 +3309,7 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
'802.11 N')
- ((hotspot_n_enabled++))
-
- if (( $hotspot_n_enabled >= 2 )); then
-
- hotspot_n_enabled=0
-
- fi
-
+ (( $hotspot_n_enabled )) && hotspot_n_enabled=0 || hotspot_n_enabled=1
G_CONFIG_INJECT 'ieee80211n=' "ieee80211n=$hotspot_n_enabled" /etc/hostapd/hostapd.conf
;;
@@ -3462,16 +3322,11 @@ Would you like to disable WiFi? \n - (NOTICE) Connections may drop!'; then
'Disable')
- G_WHIP_YESNO 'Would you like to disable the WiFi adapter?\n - (NOTICE) All WiFi connections will be dropped.'
- if (( $? == 0 )); then
-
- WIFI_DISABLED=1
- WiFi_Monitor_Disable
- Network_ApplyChanges
-
- TARGETMENUID=8
-
- fi
+ G_WHIP_YESNO 'Would you like to disable the WiFi adapter?\n - (NOTICE) All WiFi connections will be dropped.' || return
+ WIFI_DISABLED=1
+ WiFi_Monitor_Disable
+ Network_ApplyChanges
+ TARGETMENUID=8
;;
@@ -3701,7 +3556,7 @@ Additional benchmarks:
sed -i '/arm_freq=/c\#arm_freq=1500' /DietPi/config.txt
sed -i '/core_freq=/c\#core_freq=500' /DietPi/config.txt
- sed -i '/sdram_freq=/c\#sdram_freq=3200' /DietPi/config.txt
+ sed -i '/sdram_freq=/d' /DietPi/config.txt
elif (( $G_HW_MODEL == 3 )); then
@@ -3762,7 +3617,7 @@ Additional benchmarks:
local over_voltage_value=$(grep -m1 'over_voltage=' /DietPi/config.txt | tr -d '#over_voltage=')
local arm_freq_value=$(grep -m1 'arm_freq=' /DietPi/config.txt | tr -d '#arm_freq=')
local core_freq_value=$(grep -m1 'core_freq=' /DietPi/config.txt | tr -d '#core_freq=')
- local sdram_freq_value=$(grep -m1 'sdram_freq=' /DietPi/config.txt | tr -d '#sdram_freq=')
+ (( $G_HW_MODEL == 4 )) || local sdram_freq_value=$(grep -m1 'sdram_freq=' /DietPi/config.txt | tr -d '#sdram_freq=')
# Overclocking RPi1
# - Zero
@@ -3814,8 +3669,8 @@ Additional benchmarks:
'safe')
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=2' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=900' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=2' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=900' /DietPi/config.txt
;;
@@ -3824,9 +3679,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=4' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=900' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=500' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=4' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=900' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
fi
@@ -3837,9 +3692,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=6' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=1025' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=500' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=6' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1025' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
fi
@@ -3854,10 +3709,10 @@ Additional benchmarks:
G_WHIP_MENU_ARRAY=(
- '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'
- 'extreme' ': 1050 MHz ARM | 500 MHz core | 450 MHz SDRAM | 6 overvolt'
+ 'none' ': 900 MHz ARM | 250 MHz core | 400 MHz SDRAM | 0 overvolt'
+ 'low' ': 1000 MHz ARM | 250 MHz core | 400 MHz SDRAM | 3 overvolt'
+ 'med' ': 1000 MHz ARM | 500 MHz core | 400 MHz SDRAM | 5 overvolt'
+ 'extreme' ': 1050 MHz ARM | 500 MHz core | 400 MHz SDRAM | 6 overvolt'
)
@@ -3879,8 +3734,8 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=3' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=1000' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=3' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1000' /DietPi/config.txt
fi
@@ -3891,9 +3746,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=5' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=1000' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=500' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=5' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1000' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
fi
@@ -3904,9 +3759,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=6' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=1050' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=500' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=6' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1050' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
fi
@@ -3954,9 +3809,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/arm_freq=/c\arm_freq=1300' /DietPi/config.txt
- sed -i '/over_voltage=/c\over_voltage=3' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=400' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=3' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1300' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=400' /DietPi/config.txt
fi
@@ -3967,9 +3822,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/arm_freq=/c\arm_freq=1325' /DietPi/config.txt
- sed -i '/over_voltage=/c\over_voltage=4' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=400' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=4' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1325' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=400' /DietPi/config.txt
fi
@@ -3980,9 +3835,9 @@ Additional benchmarks:
if Warning_Overclocking; then
Reset_Overclocking
- sed -i '/over_voltage=/c\over_voltage=5' /DietPi/config.txt
- sed -i '/arm_freq=/c\arm_freq=1350' /DietPi/config.txt
- sed -i '/core_freq=/c\core_freq=400' /DietPi/config.txt
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=5' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1350' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=400' /DietPi/config.txt
fi
@@ -3992,6 +3847,77 @@ Additional benchmarks:
fi
+ # Overclocking Pi4
+ elif (( $G_HW_MODEL == 4 )); then
+
+ G_WHIP_MENU_ARRAY=(
+
+ 'energy saving' ': 1500 MHz ARM | 500 MHz core | -2 overvolt'
+ 'default' ': 1500 MHz ARM | 500 MHz core | 0 overvolt'
+ 'safe' ': 1600 MHz ARM | 500 MHz core | 0 overvolt'
+ 'medium GPU' ': 1600 MHz ARM | 600 MHz core | 2 overvolt'
+ 'medium ARM' ': 1750 MHz ARM | 500 MHz core | 2 overvolt'
+ 'high GPU' ': 1750 MHz ARM | 600 MHz core | 4 overvolt'
+ 'high ARM' ': 1900 MHz ARM | 500 MHz core | 4 overvolt'
+
+ )
+
+ G_WHIP_MENU "Hardware : $G_HW_MODEL_DESCRIPTION\nCurrent: $arm_freq_value MHz ARM | $core_freq_value MHz core | $over_voltage_value overvolt"
+ if (( $? == 0 )); then
+
+ TARGETMENUID=13 # Return to this menu
+ Reset_Overclocking
+
+ case "$G_WHIP_RETURNED_VALUE" in
+
+ 'energy saving')
+
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=-2' /DietPi/config.txt
+
+ ;;
+
+ 'safe')
+
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1600' /DietPi/config.txt
+
+ ;;
+
+ 'medium GPU')
+
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=2' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1600' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=600' /DietPi/config.txt
+
+ ;;
+
+ 'medium ARM')
+
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=2' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1750' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
+
+ ;;
+
+ 'high GPU')
+
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=4' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1750' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=600' /DietPi/config.txt
+
+ ;;
+
+ 'high ARM')
+
+ G_CONFIG_INJECT 'over_voltage=' 'over_voltage=4' /DietPi/config.txt
+ G_CONFIG_INJECT 'arm_freq=' 'arm_freq=1900' /DietPi/config.txt
+ G_CONFIG_INJECT 'core_freq=' 'core_freq=500' /DietPi/config.txt
+
+ ;;
+
+ esac
+
+ fi
+
fi
}
@@ -4001,41 +3927,55 @@ Additional benchmarks:
TARGETMENUID=0
- local soundcard_current=$(grep -m1 '^[[:blank:]]*CONFIG_SOUNDCARD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ if ! command -v aplay &> /dev/null; then
- G_WHIP_MENU_ARRAY=('Soundcard' ": [$soundcard_current]")
+ G_WHIP_MENU_ARRAY=('Enable' ': Install ALSA to enable audio capabilities')
- if dpkg-query -s alsa-utils &> /dev/null; then
+ else
+ local soundcard_current=$(sed -n '/^[[:blank:]]*CONFIG_SOUNDCARD=/{s/^[^=]*=//;p;q}' /DietPi/dietpi.txt)
+ G_WHIP_MENU_ARRAY=('Soundcard' ": [$soundcard_current]")
G_WHIP_MENU_ARRAY+=('DietPi-JustBoom' ': Launches EQ and MPD audio options menu')
- fi
-
- # - RPi, low power mode (PSU noise ripple reduction): https://github.com/MichaIng/DietPi/issues/757
- if (( $G_HW_MODEL < 10 )); then
-
- local current_cpu_governor=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_GOVERNOR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local hdmi_output=1
- grep -q '^[[:blank:]]*hdmi_ignore_hotplug=1' /DietPi/config.txt && grep -q '^[[:blank:]]*hdmi_ignore_composite=1' /DietPi/config.txt && hdmi_output=0
- local psu_noise_reduction_enabled=0
- if [[ $current_cpu_governor == 'powersave' && $hdmi_output == 0 ]]; then
+ # - RPi, low power mode (PSU noise ripple reduction): https://github.com/MichaIng/DietPi/issues/757
+ if (( $G_HW_MODEL < 10 )); then
- G_WHIP_MENU_ARRAY+=('PSU noise reduction' ': [On]')
- psu_noise_reduction_enabled=1
+ local psu_noise_reduction_enabled=0
+ local psu_noise_reduction_text='Off'
+ if grep -q '^[[:blank:]]*CONFIG_CPU_GOVERNOR=powersave' /DietPi/dietpi.txt &&
+ grep -q '^[[:blank:]]*hdmi_ignore_hotplug=1' /DietPi/config.txt &&
+ grep -q '^[[:blank:]]*hdmi_ignore_composite=1' /DietPi/config.txt; then
- else
+ psu_noise_reduction_enabled=1
+ psu_noise_reduction_text='On'
- G_WHIP_MENU_ARRAY+=('PSU noise reduction' ': [Off]')
+ fi
+ G_WHIP_MENU_ARRAY+=('PSU noise reduction' ": [$psu_noise_reduction_text]")
fi
+ G_WHIP_MENU_ARRAY+=('' '●─' 'Disable' ': Disable all audio capabilities')
+
fi
+ G_WHIP_DEFAULT_ITEM='Soundcard'
if G_WHIP_MENU 'Please select an option:'; then
TARGETMENUID=14 # Return to this menu
- if [[ $G_WHIP_RETURNED_VALUE == 'PSU noise reduction' ]]; then
+ if [[ $G_WHIP_RETURNED_VALUE == 'Disable' ]]; then
+
+ /DietPi/dietpi/func/dietpi-set_hardware soundcard none
+ G_AGP alsa-utils firmware-intel-sound
+ G_AGA
+ [[ -f '/DietPi/dietpi/.installed' ]] && G_CONFIG_INJECT 'aSOFTWARE_INSTALL_STATE\[5\]=' 'aSOFTWARE_INSTALL_STATE[5]=0' /DietPi/dietpi/.installed
+
+ elif [[ $G_WHIP_RETURNED_VALUE == 'Enable' ]]; then
+
+ G_AG_CHECK_INSTALL_PREREQ alsa-utils
+ [[ -f '/DietPi/dietpi/.installed' ]] && G_CONFIG_INJECT 'aSOFTWARE_INSTALL_STATE\[5\]=' 'aSOFTWARE_INSTALL_STATE[5]=2' /DietPi/dietpi/.installed
+
+ elif [[ $G_WHIP_RETURNED_VALUE == 'PSU noise reduction' ]]; then
if (( ! $psu_noise_reduction_enabled )); then
@@ -4044,14 +3984,12 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' 'CONFIG_CPU_GOVERNOR=powersave' /DietPi/dietpi.txt
/DietPi/dietpi/func/dietpi-set_cpu
-
/DietPi/dietpi/func/dietpi-set_hardware headless 1
else
G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' 'CONFIG_CPU_GOVERNOR=ondemand' /DietPi/dietpi.txt
/DietPi/dietpi/func/dietpi-set_cpu
-
/DietPi/dietpi/func/dietpi-set_hardware headless 0
fi
@@ -4062,17 +4000,13 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
G_WHIP_MENU_ARRAY=()
- # - Global:
# RPi, all but rpi-bcm2835 disables
if (( $G_HW_MODEL < 10 )); then
- G_WHIP_MENU_ARRAY+=('none' ': Disables HDMI sound + 3.5mm analogue')
- G_WHIP_MENU_ARRAY+=('rpi-bcm2835' ': Onboard: HDMI (if plugged in, else 3.5mm)')
+ G_WHIP_MENU_ARRAY+=('rpi-bcm2835-auto' ': Onboard: HDMI if plugged in, else 3.5mm')
G_WHIP_MENU_ARRAY+=('rpi-bcm2835-3.5mm' ': Onboard: 3.5mm forced output')
- G_WHIP_MENU_ARRAY+=('rpi-bcm2835-ultrahq' ': Onboard HQ: HDMI (if plugged in, else 3.5mm)')
- G_WHIP_MENU_ARRAY+=('rpi-bcm2835-ultrahq-3.5mm' ': Onboard HQ: 3.5mm forced output')
+ G_WHIP_MENU_ARRAY+=('rpi-bcm2835-hdmi' ': Onboard: HDMI forced output')
G_WHIP_MENU_ARRAY+=('allo-boss-dac-pcm512x-audio' ': Allo Boss DAC')
- G_WHIP_MENU_ARRAY+=('allo-boss-dac-pcm512x-audio' ': Allo Mini Boss DAC')
G_WHIP_MENU_ARRAY+=('allo-digione' ': Allo DigiOne')
G_WHIP_MENU_ARRAY+=('allo-katana-dac-audio' ': Allo Katana DAC')
G_WHIP_MENU_ARRAY+=('allo-piano-dac-pcm512x-audio' ': Allo Piano DAC')
@@ -4084,9 +4018,12 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
G_WHIP_MENU_ARRAY+=('hifiberry-amp' ': HifiBerry AMP / AMP+')
G_WHIP_MENU_ARRAY+=('hifiberry-dac' ': HifiBerry DAC / MiniAMP')
G_WHIP_MENU_ARRAY+=('hifiberry-dacplus' ': HifiBerry DAC+ / DAC+ Pro / AMP2')
- G_WHIP_MENU_ARRAY+=('hifiberry-digi' ': HifiBerry DIGI / DIGI+')
- G_WHIP_MENU_ARRAY+=('hifiberry-digi-pro' ': HifiBerry DIGI Pro')
+ G_WHIP_MENU_ARRAY+=('hifiberry-dacplusadc' ': HifiBerry DAC+ADC')
+ G_WHIP_MENU_ARRAY+=('hifiberry-dacplusadcpro' ': HifiBerry DAC+ADC Pro')
+ G_WHIP_MENU_ARRAY+=('hifiberry-digi' ': HifiBerry Digi / Digi+')
+ G_WHIP_MENU_ARRAY+=('hifiberry-digi-pro' ': HifiBerry Digi+ Pro')
G_WHIP_MENU_ARRAY+=('i-sabre-q2m' ': AudioPhonics I-Sabre ES9028Q2M / ES9038Q2M')
+ G_WHIP_MENU_ARRAY+=('iqaudio-dac' ': IQaudio DAC audio card')
G_WHIP_MENU_ARRAY+=('iqaudio-dacplus' ': Pi-DAC+, Pi-DACZero, Pi-DAC Pro, Pi-DigiAMP+')
G_WHIP_MENU_ARRAY+=('iqaudio-digi-wm8804-audio' ': Pi-DIGI+')
G_WHIP_MENU_ARRAY+=('iqaudio-dacplus,auto_mute_amp' ': Pi-DigiAMP+')
@@ -4095,83 +4032,40 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
G_WHIP_MENU_ARRAY+=('justboom-digi' ': JustBoom: Digi HAT and Digi Zero')
G_WHIP_MENU_ARRAY+=('rpi-dac' ': Soekris DAM1021 (pcm1794a)')
- # NanoPi M2/M3, BPi Pro, OPi Zero
- elif (( $G_HW_MODEL == 32 || $G_HW_MODEL == 51 || $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then
-
- G_WHIP_MENU_ARRAY+=('default' ': 3.5mm Analogue')
-
- # Native PC/MISC devices | Detect and list available
- elif (( $G_HW_MODEL == 15 ||
- $G_HW_MODEL == 21 ||
- $G_HW_MODEL == 40 || $G_HW_MODEL == 42 || $G_HW_MODEL == 43 ||
- $G_HW_MODEL == 44 || $G_HW_MODEL == 67 )); then
-
- G_WHIP_MENU_ARRAY+=('default' ': HW:0,0')
-
- # Install prereqs to allow for detection
- dpkg-query -s alsa-utils &> /dev/null || /DietPi/dietpi/func/dietpi-set_hardware soundcard default
-
- for i in {0..9}
- do
-
- if [[ -f /proc/asound/card$i/id ]]; then
-
- for j in {0..9}
- do
-
- if [[ -f /proc/asound/card$i/pcm${j}p/info ]]; then
-
- local card_index=$(mawk '/^card:/ {print $2;exit}' /proc/asound/card$i/pcm${j}p/info)
- local device_index=$(mawk '/^device:/ {print $2;exit}' /proc/asound/card$i/pcm${j}p/info)
- local card_name=$( /dev/null
+ [[ -f $fp_log ]] && rm $fp_log
if (( $STRESS_TEST_MODE == 0 )); then
@@ -4367,21 +4283,14 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
# No-IP Client
local noip_installed=0
- local noip_status='Not Installed'
- local noip_menutext='Install No-IP now'
+ local noip_menutext='[Not Installed] Install No-IP now'
if (( ${aSOFTWARE_INSTALL_STATE[67]:=0} == 2 )); then
noip_installed=1
- noip_status='Offline - Please enter No-IP details'
- noip_menutext='Enter/Setup No-IP details'
+ noip_menutext='[Offline] Enter/Setup No-IP details'
# Check if No-IP is running (indicates login details are valid)
- if pgrep '/usr/local/bin/noip2' &> /dev/null; then
-
- noip_status='Online / Active'
- noip_menutext='Change No-IP details'
-
- fi
+ pgrep '/usr/local/bin/noip2' &> /dev/null && noip_menutext='[Online] Change No-IP details'
fi
@@ -4390,7 +4299,7 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
[[ $apt_mirror_current ]] || apt_mirror_current='Unknown, no string from scrape'
# NTP mirror
- local ntp_mirror_current=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local ntp_mirror_current=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MIRROR=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
[[ $ntp_mirror_current ]] || ntp_mirror_current='Unknown, no string from scrape'
# Network boot wait
@@ -4410,8 +4319,8 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
fi
- local check_url_timeout=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local check_url_attempts=$(grep -m1 '^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local check_url_timeout=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_TIMEOUT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local check_url_attempts=$(sed -n '/^[[:blank:]]*CONFIG_G_CHECK_URL_ATTEMPTS=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
G_WHIP_MENU_ARRAY=(
@@ -4428,7 +4337,7 @@ The following will now be applied:\n - CPU gov = Powersave\n - HDMI output = Dis
)
- if G_WHIP_MENU ''; then
+ if G_WHIP_MENU; then
TARGETMENUID=16 # Return to this menu
@@ -4485,17 +4394,6 @@ Please enter a value between $min and $max." && G_CHECK_VALIDINT "$G_WHIP_RETURN
'APT Mirror')
- # Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864
- if (( $G_HW_ARCH == 3 && $G_DISTRO < 4 )); then
-
- G_WHIP_MSG '[ INFO ] Debian has dropped the Jessie ARMv8 branch from the official APT repository.\n
-Related packages are now available only from the archive: http://archive.debian.org/debian/\n
-This has been applied to your APT sources.list during DietPi update to v6.23 and it cannot be changed.\n
-Aborting...'
- return
-
- fi
-
local failure=''
while :
do
@@ -4573,46 +4471,31 @@ Aborting...'
"Custom": Manually enter local or external NTP server address(es).\n
"Default": Leave mirror choice to system. Usually falls back to local gateway (Stretch+ only) or "debian.pool.ntp.org".\n
Use "*.pool.ntp.org" mirrors, if your device is mobile or should act as local NTP server. Further information: "http://www.pool.ntp.org/zone/@"'
- if (( $? == 0 )) && [[ $G_WHIP_RETURNED_VALUE ]]; then
-
- local new_setting_ntp_mirror=$G_WHIP_RETURNED_VALUE
- local previous_setting_ntp_mirror=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-
- local apply=1
+ if [[ $? == 0 && $G_WHIP_RETURNED_VALUE ]]; then
case $G_WHIP_RETURNED_VALUE in
'Custom')
G_WHIP_DEFAULT_ITEM=$ntp_mirror_current
- if G_WHIP_INPUTBOX 'Please enter one or more (space-separated) NTP mirrors.\n
+ G_WHIP_INPUTBOX 'Please enter one or more (space-separated) NTP mirrors.\n
NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The subdomains 0-3 will be added automatically.
-- Enter "uk.pool.ntp.org" to use [0-3].uk.pool.ntp.org'; then
-
- new_setting_ntp_mirror=$G_WHIP_RETURNED_VALUE
-
- else
-
- apply=0
-
- fi
+- Enter "uk.pool.ntp.org" to use [0-3].uk.pool.ntp.org' || return
;;
esac
- if (( $apply )); then
-
- G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$new_setting_ntp_mirror" /DietPi/dietpi.txt
- /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- if ! MAX_LOOPS_CHECK=10 /DietPi/dietpi/func/run_ntpd 1; then
-
- G_WHIP_MSG "Time sync failed:\n - $G_WHIP_RETURNED_VALUE\n\nSetting reverted to previous."
+ G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$G_WHIP_RETURNED_VALUE" /DietPi/dietpi.txt
+ /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ # Run time sync only, if not currently running, to avoid concurrent execution if dietpi-config was called from DietPi-Run_NTPD error handler
+ # - Run non-interactively to avoid its internal error handler allowing to open a concurrent dietpi-config instance
+ pgrep -cif /dietpi/func/run_ntpd &> /dev/null && return
+ if ! G_INTERACTIVE=0 MAX_LOOPS_CHECK=10 /DietPi/dietpi/func/run_ntpd 1; then
- G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$previous_setting_ntp_mirror" /DietPi/dietpi.txt
- /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-
- fi
+ G_WHIP_MSG "Time sync failed:\n - $G_WHIP_RETURNED_VALUE\n\nSetting reverted to previous."
+ G_CONFIG_INJECT 'CONFIG_NTP_MIRROR=' "CONFIG_NTP_MIRROR=$ntp_mirror_current" /DietPi/dietpi.txt
+ /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
fi
@@ -4698,10 +4581,10 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s
else
- [[ $PROXY_ADDRESS ]] || PROXY_ADDRESS=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_ADDRESS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- [[ $PROXY_PORT ]] || PROXY_PORT=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PORT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- [[ $PROXY_USERNAME ]] || PROXY_USERNAME=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_USERNAME=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- [[ $PROXY_PASSWORD ]] || PROXY_PASSWORD=$(grep -m1 '^[[:blank:]]*CONFIG_PROXY_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ [[ $PROXY_ADDRESS ]] || PROXY_ADDRESS=$(sed -n '/^[[:blank:]]*CONFIG_PROXY_ADDRESS=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ [[ $PROXY_PORT ]] || PROXY_PORT=$(sed -n '/^[[:blank:]]*CONFIG_PROXY_PORT=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ [[ $PROXY_USERNAME ]] || PROXY_USERNAME=$(sed -n '/^[[:blank:]]*CONFIG_PROXY_USERNAME=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ [[ $PROXY_PASSWORD ]] || PROXY_PASSWORD=$(sed -n '/^[[:blank:]]*CONFIG_PROXY_PASSWORD=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
fi
@@ -4718,10 +4601,10 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s
G_WHIP_MENU_ARRAY=(
'State' ": [$proxy_state_text]"
- 'Address' ": $PROXY_ADDRESS"
- 'Port' ": $PROXY_PORT"
- 'Username' ": $PROXY_USERNAME"
- 'Password' ": $PROXY_PASSWORD"
+ 'Address' ": [$PROXY_ADDRESS]"
+ 'Port' ": [$PROXY_PORT]"
+ 'Username' ": [$PROXY_USERNAME]"
+ 'Password' ": [$PROXY_PASSWORD]"
)
@@ -4769,7 +4652,7 @@ NB: If you need to use *.pool.ntp.org servers, enter the base domain only. The s
esac
- # - Add export settings
+ # Add export settings
if (( $PROXY_ENABLED )); then
if [[ $PROXY_USERNAME && $PROXY_PASSWORD ]]; then
@@ -4804,7 +4687,7 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
- if (( $G_DIETPI_INSTALL_STAGE >= 0 )); then
+ if (( $G_DIETPI_INSTALL_STAGE > 0 )); then
# Start DietPi-Config
while (( $TARGETMENUID >= 0 )); do
@@ -4906,7 +4789,7 @@ Please report it to: https://github.com/MichaIng/DietPi/issues"
else
- G_WHIP_MSG '[INFO] First run setup has not reached sufficient state.\n\nPlease reboot before using DietPi-Config. If the issue persists, please report this as bug.'
+ G_WHIP_MSG '[ INFO ] First run setup has not reached sufficient state.\n\nPlease reboot before using DietPi-Config. If the issue persists, please report this as bug.'
fi
diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager
index 6ceb8fa38d..8b8787cda3 100644
--- a/dietpi/dietpi-drive_manager
+++ b/dietpi/dietpi-drive_manager
@@ -9,7 +9,7 @@
#////////////////////////////////////
#
# Info:
- # - Location: /DietPi/dietpi/dietpi-drive_manager
+ # - Location: /{DietPi,boot}/dietpi/dietpi-drive_manager
#
# Usage:
# - = Interactive menu
@@ -102,47 +102,43 @@
Init_Drives_and_Refresh(){
- #---------------------------------------------------------------
# Reset current index and delete arrays
local i index=-1
Destroy
- # Obtain actual user data location on disk (follows symlinks)
+ # Obtain actual user data location on disk (follow symlinks)
FP_USERDATA_CURRENT=$(readlink -f $G_FP_DIETPI_USERDATA)
# Swapfile location
- FP_SWAPFILE_CURRENT=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ FP_SWAPFILE_CURRENT=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_LOCATION=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
- # RootFS location
+ # RootFS device location
FP_ROOTFS_SOURCE=$(findmnt -no source /)
# Create tmp fstab
local fp_fstab_tmp='.fstab'
cp -a /etc/fstab $fp_fstab_tmp
- # Mounts
- local swap_mount=''
- local tmpfs_mounts=''
- local misc_mounts=''
- local net_mounts=''
+ # Special mounts
+ local swap_mounts tmpfs_mounts misc_mounts net_mounts
# Mode 4: Force reset/clean fstab (PREP)
if (( $INPUT == 4 )); then
- local var_log_size=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- tmpfs_mounts="tmpfs /tmp tmpfs defaults,noatime,nodev,nosuid,mode=1777 0 0
-tmpfs /var/log tmpfs defaults,size=${var_log_size}m,noatime,nodev,nosuid,mode=1777 0 0
-tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0"
+ local var_log_size=$(sed -n '/^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ tmpfs_mounts="tmpfs /tmp tmpfs noatime,lazytime,nodev,nosuid,mode=1777
+tmpfs /DietPi tmpfs size=10m,noatime,lazytime,nodev,nosuid,mode=1755
+tmpfs /var/log tmpfs size=${var_log_size}m,noatime,lazytime,nodev,nosuid,mode=1777"
# Else: Grab current mounts
else
- swap_mount=$(grep -m1 '^[[:blank:]]*[^#].*[[:blank:]]swap[[:blank:]]' $fp_fstab_tmp)
- tmpfs_mounts=$(grep '^tmpfs[[:blank:]]' $fp_fstab_tmp)
+ swap_mounts=$(grep '^[[:blank:]]*[^#].*[[:blank:]]swap[[:blank:]]' $fp_fstab_tmp)
+ tmpfs_mounts=$(grep '^[[:blank:]]*tmpfs[[:blank:]]' $fp_fstab_tmp)
# ecryptfs, vboxsf, bind mounts
misc_mounts=$(grep -E '^[[:blank:]]*[^#].*([[:blank:]](ecryptfs|vboxsf)[[:blank:]]|[[:blank:],]bind[[:blank:],])' $fp_fstab_tmp)
# CurlFtpFS, CIFS/SMB/Samba, NFS
- net_mounts=$(grep -E '(^curlftpfs|[[:blank:]](cifs|nfs4?)[[:blank:]])' $fp_fstab_tmp)
+ net_mounts=$(grep -E '^[[:blank:]]*(curlftpfs|[^#].*[[:blank:]](cifs|nfs4?)[[:blank:]])' $fp_fstab_tmp)
fi
@@ -165,19 +161,19 @@ $misc_mounts
#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------
-$swap_mount
+$swap_mounts
#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------" > $fp_fstab_tmp
- # Detect mounted drives and add them to fstab
+ # Detect mounted drives
G_DIETPI-NOTIFY 2 'Detecting drives, please wait...'
# - Only detect mounts with valid source path (word 1 contains "/")
- mawk '$1~/\// {print}' <<< $(df -Pha) > .df_out_tmp
+ mawk '$1~/\//{print}' <<< $(df -Pha) > .df_out_tmp
- # - Remove misc items from list
- # bind: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374
+ # Remove misc items from list
+ # - bind: https://github.com/MichaIng/DietPi/issues/2013#issuecomment-416394374
[[ $misc_mounts ]] && while read line
do
@@ -190,7 +186,7 @@ $swap_mount
done <<< "$misc_mounts"
- # - Process final df result
+ # Process final df result
while read line
do
@@ -203,7 +199,7 @@ $swap_mount
aDRIVE_SIZE_FREE[$index]=$(mawk '{print $4}' <<< $line)
aDRIVE_SIZE_PERCENTUSED[$index]=$(mawk '{print $5}' <<< $line)
aDRIVE_MOUNT_TARGET[$index]=$(mawk '{print $6}' <<< $line)
- # - Workaround for /dev/root under RPi, force physical location
+ # Workaround for /dev/root under RPi, force physical location
[[ ${aDRIVE_MOUNT_TARGET[$index]} == '/' ]] && aDRIVE_MOUNT_SOURCE[$index]=$FP_ROOTFS_SOURCE
aDRIVE_SOURCE_DEVICE[$index]=$(Return_Drive_Without_Partitions ${aDRIVE_MOUNT_SOURCE[$index]})
@@ -211,13 +207,13 @@ $swap_mount
aDRIVE_UUID[$index]=$(blkid ${aDRIVE_MOUNT_SOURCE[$index]} -s UUID -o value)
(( ${aDRIVE_ISPARTITIONTABLE[$index]} )) && aDRIVE_PART_UUID[$index]=$(blkid ${aDRIVE_MOUNT_SOURCE[$index]} -s PARTUUID -o value)
- # - Physical?
+ # Physical?
if [[ -d '/sys/block/'${aDRIVE_SOURCE_DEVICE[$index]} ]]; then
aDRIVE_FSTYPE[$index]=$(blkid ${aDRIVE_MOUNT_SOURCE[$index]} -s TYPE -o value)
[[ ${aDRIVE_FSTYPE[$index]} ]] && aDRIVE_ISFILESYSTEM[$index]=1
- # - Networked
+ # Networked
else
aDRIVE_ISNETWORKED[$index]=1
@@ -228,8 +224,8 @@ $swap_mount
G_DIETPI-NOTIFY 2 " - Detected mounted drive: ${aDRIVE_MOUNT_SOURCE[$index]} > ${aDRIVE_MOUNT_TARGET[$index]}"
- # - RO mounted?
- # - NB: We can't use -m1 for initial check as results can be:
+ # R/O mounted?
+ # NB: We can't use -m1 for initial check as results can be:
# root@DietPi:~# cat /proc/mounts | grep ' / '
# rootfs / rootfs rw 0 0
# /dev/mmcblk0p2 / ext4 ro,noatime,discard,data=ordered 0 0
@@ -237,7 +233,7 @@ $swap_mount
aDRIVE_ISREADONLY_CURRENTLY[$index]=1
- # - RootFS RW check
+ # RootFS R/W check
if [[ ${aDRIVE_MOUNT_TARGET[$index]} == '/' ]]; then
if G_WHIP_YESNO "RootFS is currently set to \"Read Only (R/O)\". $G_PROGRAM_NAME requires \"Read Write (R/W)\" access to function.\n\nWould you like to re-enable R/W access on RootFS?"; then
@@ -258,24 +254,34 @@ $swap_mount
fi
- # - Add entry to fstab
+ # Add entry to fstab
if [[ ${aDRIVE_UUID[$index]} ]]; then
- local options=',rw'
- (( ${aDRIVE_ISREADONLY_CURRENTLY[$index]} )) && options=',ro'
+ local options=''
- # - Root/BootFS dependant flags
- # On RPi we need to use PARTUUID for Root/BootFS
+ # R/O?
+ (( ${aDRIVE_ISREADONLY_CURRENTLY[$index]} )) && options+=',ro'
+
+ # Additional FS-specific options
+ # - NFTS: Enable POSIX permissions
+ if [[ ${aDRIVE_FSTYPE[$index]} == 'ntfs' ]]; then
+
+ options+=',permissions'
+
+ fi
+
+ # Root/BootFS dependant flags
+ # - fsck flag for RootFS, to allow check on reboot and for BootFS, since corruption here is most critical and fsck finishes in no time
+ # - nofail: Allow boot to continue, if mount fails, not wanted for Root/BootFS
+ # - x-systemd.automount: [ 1166.110202] systemd-fstab-generator[3512]: Ignoring automount option for root device
+ # /boot is removed from local-fs.target by this (on Buster only?), allowing it to mount after RAMdisk starts and unmount before it stops.
+ # Source device entry
local dev_entry="UUID=${aDRIVE_UUID[$index]}"
- # fsck flag for RootFS, to allow check on reboot and for BootFS, since corruption here is most critical and fsck finishes in no time
- # nofail: Allow boot to continue, if mount fails, not wanted for Root/BootFS
- # x-systemd.automount: [ 1166.110202] systemd-fstab-generator[3512]: Ignoring automount option for root device
- # /boot is removed from local-fs.target by this (on Buster only?), allowing it to mount after RAMdisk starts and unmount before it stops.
- local fsck_flag=0
- if [[ ${aDRIVE_MOUNT_TARGET[$index]} =~ ^/(boot)?$ ]]; then
+ if [[ ${aDRIVE_MOUNT_TARGET[$index]} =~ ^/(boot(/efi)?)?$ ]]; then
+ # On RPi we need to use PARTUUID for Root/BootFS
(( $G_HW_MODEL < 10 )) && dev_entry="PARTUUID=${aDRIVE_PART_UUID[$index]}"
- fsck_flag=1
+ options+=' 0 1' # dump + fsck flag
else
@@ -283,29 +289,25 @@ $swap_mount
fi
- # - Additional options for fs type specific items
- # NFTS: Enable POSIX permissions for NTFS
- if [[ ${aDRIVE_FSTYPE[$index]} == 'ntfs' ]]; then
+ # FS type: In case of unknown network drive, use "auto", to allow remove FS changes without breaking the fstab entry
+ local type=${aDRIVE_FSTYPE[$index]}
+ (( ${aDRIVE_ISNETWORKED[$index]} )) && type='auto'
- options+=',permissions'
-
- fi
-
- echo "$dev_entry ${aDRIVE_MOUNT_TARGET[$index]} auto defaults,noatime$options 0 $fsck_flag" >> $fp_fstab_tmp
+ echo "$dev_entry ${aDRIVE_MOUNT_TARGET[$index]} $type noatime,lazytime$options" >> $fp_fstab_tmp
fi
done < .df_out_tmp
rm .df_out_tmp
- # - Check blkid for unmounted drives, if drive is not mounted, add entry as disabled/commented mount
+ # Check blkid for unmounted drives, if drive is not mounted, add entry as disabled/commented mount
blkid -o device > .blkid_out_tmp
while read line
do
[[ $line ]] || continue
- # - Exclude drives already found
+ # Exclude drives already found
for i in "${aDRIVE_MOUNT_SOURCE[@]}"
do
@@ -313,7 +315,7 @@ $swap_mount
done
- # - Must have a valid UUID! (this excludes /dev/mmcblk0)
+ # Must have a valid UUID! (this excludes /dev/mmcblk0)
local uuid=$(blkid $line -s UUID -o value)
[[ $uuid ]] || continue
@@ -335,15 +337,15 @@ $swap_mount
done < .blkid_out_tmp
rm .blkid_out_tmp
- # - Find unformated drives
- # Exclude mtdblock devices: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-422400520
+ # Find unformated drives
+ # - Exclude mtdblock devices: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-422400520
lsblk -nro NAME | sed '/^mtdblock[0-9]/d' > .lsblk_out_tmp
while read line
do
[[ $line ]] || continue
- # - Exclude drives already found
+ # Exclude drives already found
for i in "${aDRIVE_SOURCE_DEVICE[@]}"
do
@@ -362,14 +364,14 @@ $swap_mount
done < .lsblk_out_tmp
rm .lsblk_out_tmp
- # - Set required global flags and deps for all drives found
+ # Set required global flags and deps for all drives found
for i in ${!aDRIVE_MOUNT_SOURCE[@]}
do
- # - Detect and set ROM drives
+ # Detect and set ROM drives
[[ ${aDRIVE_MOUNT_SOURCE[$i]} == '/dev/sr'* ]] && aDRIVE_ISROM[$i]=1
- # - Collect required APT packages for FS R/W access
+ # Collect required APT packages for FS R/W access
if [[ ${aDRIVE_FSTYPE[$i]} == 'ntfs' ]]; then
local need_ntfs='ntfs-3g'
@@ -378,11 +380,15 @@ $swap_mount
local need_hfs='hfsplus'
+ elif [[ ${aDRIVE_FSTYPE[$i]} == 'exfat' ]]; then
+
+ local need_exfat='exfat-fuse'
+
fi
done
- # - Debug drive detection, exit after first init
+ # Debug drive detection, exit after first init
if [[ $G_DEBUG == 1 ]]; then
G_DIETPI-NOTIFY 0 'DEBUG INFO:'
@@ -412,7 +418,7 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]}
fi
- # - Remove x-systemd.automount if not supported by kernel: https://github.com/MichaIng/DietPi/issues/1607#issuecomment-372030565
+ # Remove x-systemd.automount if not supported by kernel: https://github.com/MichaIng/DietPi/issues/1607#issuecomment-372030565
if ! modprobe autofs4 --dry-run &> /dev/null; then
sed -i 's/,x-systemd.automount//g' $fp_fstab_tmp
@@ -422,17 +428,18 @@ aDRIVE_ISPARTITIONTABLE ${aDRIVE_ISPARTITIONTABLE[$i]}
Update_Menu_Drive_Index
+ # Move new fstab in place and reload systemd generators
cp -a $fp_fstab_tmp /etc/fstab
systemctl daemon-reload
rm $fp_fstab_tmp
- # - Install required APT packages for FS R/W access
- (( ! $APT_CHECK )) && [[ $need_ntfs || $need_hfs ]] && G_AG_CHECK_INSTALL_PREREQ $need_ntfs $need_hfs && APT_CHECK=1
+ # Install required APT packages for FS R/W access
+ [[ $APT_CHECK == 0 && $need_ntfs$need_hfs$need_exfat ]] && G_AG_CHECK_INSTALL_PREREQ $need_ntfs $need_hfs $need_exfat && APT_CHECK=1
sync
mount -a
- }
+ }
Update_Menu_Drive_Index(){
@@ -483,7 +490,7 @@ NB: The path must start with /mnt/ and be unique. Spaces will be converted autom
if [[ $G_WHIP_RETURNED_VALUE == '/mnt/'* ]]; then
- # - Replace spaces with underscores
+ # Replace spaces with underscores
target=${G_WHIP_RETURNED_VALUE//[[:space:]]/_}
else
@@ -584,17 +591,17 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
info_format_type_output='Single partition format'
- # - Unmount
+ # Unmount
umount ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}
- # - Clear partition from device
+ # Clear partition from device
G_DIETPI-NOTIFY 2 "Writing zeros to partition ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}"
G_RUN_CMD dd if=/dev/zero of=${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]} bs=4K count=1337
# Drive format: Create a new partition table
else
- # - Umount and zero all partitions on device
+ # Umount and zero all partitions on device
for i in /dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}?*
do
@@ -605,14 +612,14 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
done
- # - Unmount whole drive in case of fs on drive without partition table
+ # Unmount whole drive in case of fs on drive without partition table
umount ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}
- # - Clear partition table from device
+ # Clear partition table from device
G_DIETPI-NOTIFY 2 "Writing zeros to partition table: /dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}"
G_RUN_CMD dd if=/dev/zero of=/dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]} bs=4K count=1337 # Block device wipe
- # - Create partition table type
+ # Create partition table type
local parition_table_type='gpt'
(( $FORMAT_GPT )) || parition_table_type='msdos'
@@ -624,15 +631,15 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
sleep 1 # Due to systemd automount, wait for it
umount ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}
- # - Generate new aDRIVE_MOUNT_SOURCE location to use
- # mmcblkXp1/nvmeXn1p1
+ # Generate new aDRIVE_MOUNT_SOURCE location to use
+ # - mmcblkXp1/nvmeXn1p1
aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]="/dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}p1"
- # h/sdX1
+ # - h/sdX1
if [[ ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]} == [sh]d[a-z]* ]]; then
aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]="/dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}1"
- # NanoPC-T4 + NVMe special: https://github.com/MichaIng/DietPi/issues/2102#issue-366001513
+ # - NanoPC-T4 + NVMe special: https://github.com/MichaIng/DietPi/issues/2102#issue-366001513
elif [[ $G_HW_MODEL == 68 && ${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]} == nvme* ]]; then
aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]="/dev/${aDRIVE_SOURCE_DEVICE[$MENU_DRIVE_INDEX]}p6"
@@ -659,7 +666,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
# Format FAT32
elif (( $FORMAT_FILESYSTEM_TYPE == 2 )); then
- # use 1 parition on whole device
+ # Use 1 parition on whole device
info_format_fs_type='FAT'
G_RUN_CMD mkfs.vfat -I ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}
@@ -725,12 +732,12 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
# Update fstab
cp -a /etc/fstab /etc/fstab.bak # in case of rsync fail
- # - Remove automatic entry for new uuid
+ # - Remove automatic entry for new UUID
sed -i "\@[[:blank:]]${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}[[:blank:]]@d" /etc/fstab
- # - Add new rootfs entry
+ # - Replace old with new rootfs entry
local dev_entry="UUID=${aDRIVE_UUID[$MENU_DRIVE_INDEX]}"
(( $G_HW_MODEL < 10 )) && dev_entry="PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}"
- sed -i "\@[[:blank:]]/[[:blank:]][[:blank:]]*auto@c $dev_entry / auto defaults,noatime,rw 0 1" /etc/fstab
+ sed -i "\@UUID=[^[:blank:]]*[[:blank:]][[:blank:]]*/[[:blank:]]@c $dev_entry / ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} noatime,lazytime 0 1" /etc/fstab
# Disable swap
/DietPi/dietpi/func/dietpi-set_swapfile 0
@@ -742,7 +749,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
if ! rsync -aHv --delete --exclude '/dev/*' --exclude '/sys/*' --exclude '/proc/*' --exclude '/run/*' $exclude_var_log --exclude '/lost+found/' --exclude '/boot/*' --exclude '/mnt/*' --exclude "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/" / "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/"; then
G_DIETPI-NOTIFY 1 'Rsync has failed, RootFS transfer has been aborted.'
- # - Revert fstab changes
+ # Revert fstab changes
cp -a /etc/fstab.bak /etc/fstab
exit 1
@@ -753,25 +760,24 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
# - Manually update location
#G_CONFIG_INJECT 'AUTO_SETUP_SWAPFILE_LOCATION=' 'AUTO_SETUP_SWAPFILE_LOCATION=/var/swap' /DietPi/dietpi.txt
- # RPi | cmdline.txt
+ # RPi | /boot/cmdline.txt
if (( $G_HW_MODEL < 10 )); then
- # - Find current root= and replace
+ # Find current root= and replace
local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 'root=')
sed -i "s#$rootfs_current#root=PARTUUID=${aDRIVE_PART_UUID[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt
- # - Add root delay
+ # Add root delay
grep -qi '[[:space:]]rootdelay=' /boot/cmdline.txt || sed -i "s#console=tty1#console=tty1 rootdelay=10#g" /boot/cmdline.txt
- # - Set FS type
+ # Set FS type
local rootfstype_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /boot/cmdline.txt | grep -m1 'rootfstype=')
sed -i "s#$rootfstype_current#rootfstype=${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]}#g" /boot/cmdline.txt
# C2/XU4 | /DietPi/boot.ini
- elif (( $G_HW_MODEL == 11 || $G_HW_MODEL == 12 ||
- ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then # REMOVE v6.24
+ elif (( $G_HW_MODEL == 11 || $G_HW_MODEL == 12 )); then
- # - Find current root= to replace
+ # Find current root= to replace
local rootfs_current=$(mawk '{for(i=1;i<=NF;i++) {print $i} }' /DietPi/boot.ini | grep -m1 'root=' | sed 's/\"//')
sed -i "s#$rootfs_current#root=UUID=${aDRIVE_UUID[$MENU_DRIVE_INDEX]}#g" /DietPi/boot.ini
@@ -798,7 +804,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
(( $SERVICES_STOPPED )) || { /DietPi/dietpi/dietpi-services stop; SERVICES_STOPPED=1; }
- # - RootFS, set fstab now, else, will not be applied to /etc/fstab during Init as already RO: https://github.com/MichaIng/DietPi/issues/2604
+ # RootFS, set fstab now, else, will not be applied to /etc/fstab during Init as already RO: https://github.com/MichaIng/DietPi/issues/2604
if [[ ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} == '/' ]]; then
local line_number=$(grep -n "[[:blank:]]${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}[[:blank:]].*,rw" /etc/fstab | cut -d : -f 1)
@@ -843,7 +849,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
done
- # - Add
+ # Add
(( $new_cat )) && acategory_list+=( ${aDRIVE_SOURCE_DEVICE[$i]} )
done
@@ -872,7 +878,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
# Drive has no FS:
elif (( ! ${aDRIVE_ISFILESYSTEM[$j]} )); then
- # - ROM device with no ROM attached
+ # ROM device with no ROM attached
if (( ${aDRIVE_ISROM[$j]} )); then
G_WHIP_MENU_ARRAY+=("${aDRIVE_MOUNT_TARGET[$j]}" ": ${aDRIVE_MOUNT_SOURCE[$j]} | Please insert media into the ROM device")
@@ -922,7 +928,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
MENU_LASTITEM=$G_WHIP_RETURNED_VALUE
- # - Refresh
+ # Refresh
if [[ $G_WHIP_RETURNED_VALUE == 'Refresh' ]]; then
Init_Drives_and_Refresh
@@ -991,7 +997,7 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
fi
- # - Edit drive
+ # Edit drive
elif [[ $G_WHIP_RETURNED_VALUE ]]; then
TARGETMENUID=1
@@ -1096,8 +1102,8 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
fi
- # - Swapfile
- # NB: / rootfs will always be detected in this check, however, no rootFS options for umount and format...
+ # Swapfile
+ # - NB: / rootfs will always be detected in this check, however, no rootFS options for umount and format...
local swapfile_size=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
if (( $swapfile_size > 0 )) &&
{ [[ $FP_SWAPFILE_CURRENT == ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}* && ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} != '/' ]] ||
@@ -1319,7 +1325,7 @@ Please enter the desired percentage of reserved blocks, e.g. "0.05" for 0.05% or
elif [[ $G_WHIP_RETURNED_VALUE == 'User data' ]]; then
local fp_target_userdata_dir=${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}
- # Assign location if under RootFS
+ # Assign location if under RootFS
[[ ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} == '/' ]] && fp_target_userdata_dir='/mnt'
fp_target_userdata_dir+='/dietpi_userdata'
@@ -1340,7 +1346,7 @@ Please enter the desired percentage of reserved blocks, e.g. "0.05" for 0.05% or
elif [[ $G_WHIP_RETURNED_VALUE == 'Format' ]]; then
- # - Disallow if userdata is located on this drive!
+ # Disallow if userdata is located on this drive!
if (( $partition_contains_userdata )); then
Notification 0
@@ -1349,7 +1355,7 @@ Please enter the desired percentage of reserved blocks, e.g. "0.05" for 0.05% or
Notification 1
- # - User must unmount partition on this drive, before we can format, this ensures a valid unmount check
+ # User must unmount partition on this drive, before we can format, this ensures a valid unmount check
elif (( ${aDRIVE_ISMOUNTED[$MENU_DRIVE_INDEX]} )); then
G_WHIP_MSG "The partition (${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}) must be unmounted, before formatting is allowed.\n\nPlease use the option 'Unmount' on the next screen, then retry the 'Format' option."
@@ -1368,13 +1374,13 @@ Please enter the desired percentage of reserved blocks, e.g. "0.05" for 0.05% or
# Transfer RootFS
elif [[ $G_WHIP_RETURNED_VALUE == 'Transfer RootFS' ]]; then
- # - Kernel lacks native BTRFS support (enabled as module): https://github.com/MichaIng/DietPi/issues/2909
+ # Kernel lacks native BTRFS support (enabled as module): https://github.com/MichaIng/DietPi/issues/2909
if [[ ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} == 'btrfs' ]]; then
G_WHIP_MSG "[WARNING] Booting from ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} is not supported by this device.\n
We recommend \"ext4\" as filesystem type for the RootFS."
- # - User must unmount partition before format
+ # User must unmount partition before format
elif (( ${aDRIVE_ISMOUNTED[$MENU_DRIVE_INDEX]} )); then
G_WHIP_MSG '[WARNING] Partition must be unmounted, before format and RootFS transfer can begin.\n\nPlease unmount the partition, then try again.'
@@ -1406,7 +1412,7 @@ We recommend \"ext4\" as filesystem type for the RootFS."
elif [[ $G_WHIP_RETURNED_VALUE == 'Read Only' ]]; then
- # - Disallow if userdata is located on this drive!
+ # Disallow if userdata is located on this drive!
if (( $partition_contains_swapfile )); then
Notification 1
@@ -1445,10 +1451,10 @@ We recommend \"ext4\" as filesystem type for the RootFS."
(( $SERVICES_STOPPED )) || { /DietPi/dietpi/dietpi-services stop; SERVICES_STOPPED=1; }
- # - Disable swap
+ # Disable swap
(( $partition_contains_swapfile )) && G_RUN_CMD swapoff -a
- # - Unmount drive
+ # Unmount drive
G_RUN_CMD umount ${aDRIVE_MOUNT_SOURCE[$MENU_DRIVE_INDEX]}
fi
@@ -1605,12 +1611,12 @@ Read more about I/O scheduling: https://wiki.archlinux.org/index.php/Improving_p
G_WHIP_MENU_ARRAY=()
- # - Has partition table, offer to format single partition or whole drive
+ # Has partition table, offer to format single partition or whole drive
if (( ${aDRIVE_ISPARTITIONTABLE[$MENU_DRIVE_INDEX]} )); then
G_WHIP_MENU_ARRAY+=('Format Mode' ": [$format_mode_text]")
- # - No partition table, force drive wipe
+ # No partition table, force drive wipe
else
FORMAT_MODE=0
@@ -1778,9 +1784,9 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u
G_DIETPI-NOTIFY 2 "Attempting to mount with CIFS version: $i"
if mount -t cifs -o username="$samba_clientuser",password="$samba_clientpassword",uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i //"$samba_clientname"/"$samba_clientshare" "$samba_fp_mount_target" &>> $fp_tmp; then
- # - Apply to fstab
+ # Apply to fstab
sed -i "\#[[:space:]]$samba_fp_mount_target[[:space:]]#d" /etc/fstab
- echo "//$samba_clientname/$samba_clientshare $samba_fp_mount_target cifs username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,_netdev,nofail 0 0" >> /etc/fstab
+ echo "//$samba_clientname/$samba_clientshare $samba_fp_mount_target cifs username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,_netdev,nofail" >> /etc/fstab
MENU_DRIVE_TARGET=$samba_fp_mount_target
Init_Drives_and_Refresh
@@ -1840,9 +1846,9 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u
if mount -vt nfs -o port=2049 "$nfs_server_ip":/ $nfs_fp_mount_target &>> $fp_tmp; then
- # - Apply to fstab
+ # Apply to fstab
sed -i "\#[[:space:]]$nfs_fp_mount_target[[:space:]]#d" /etc/fstab
- echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs auto,_netdev,nofail 0 0" >> /etc/fstab
+ echo "$nfs_server_ip:/ $nfs_fp_mount_target nfs auto,_netdev,nofail" >> /etc/fstab
MENU_DRIVE_TARGET=$nfs_fp_mount_target
Init_Drives_and_Refresh
@@ -1863,9 +1869,9 @@ NTFS:\nRecommended if you plan to use this drive on a Windows system. High CPU u
if mount -vt nfs -o port=2049 "$nfs_server_ip":"$nfs_fp_server_share" $nfs_fp_mount_target &>> $fp_tmp; then
- # - Apply to fstab
+ # Apply to fstab
sed -i "\#[[:space:]]$nfs_fp_mount_target[[:space:]]#d" /etc/fstab
- echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs auto,_netdev,nofail 0 0" >> /etc/fstab
+ echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs auto,_netdev,nofail" >> /etc/fstab
MENU_DRIVE_TARGET=$nfs_fp_mount_target
Init_Drives_and_Refresh
diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt
index 52d7f6dbf9..5734533472 100644
--- a/dietpi/dietpi-letsencrypt
+++ b/dietpi/dietpi-letsencrypt
@@ -9,13 +9,13 @@
#////////////////////////////////////
#
# Info:
- # - filename /DietPi/dietpi/dietpi-letsencrypt
+ # - Filename: /{DietPi,boot}/dietpi/dietpi-letsencrypt
# - Menu Frontend for Letsencrypt with CLI options for use on DietPi systems.
#
- # usage:
- # - /DietPi/dietpi/dietpi-letsencrypt = Menu
- # - /DietPi/dietpi/dietpi-letsencrypt 1 = Create/Renew/Apply cert
- #////////////////////////////////////
+ USAGE='DietPi-LetsEncrypt usage:
+ - dietpi-letsencrypt => Open whiptail menu
+ - dietpi-letsencrypt 1 => Create/Renew/Apply certs non-interactively
+' #////////////////////////////////////
# Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
@@ -32,19 +32,11 @@
# Globals
#/////////////////////////////////////////////////////////////////////////////////////
FP_LOGFILE='/var/log/dietpi-letsencrypt.log'
-
- # On Stretch+ the APT package installs a systemd unit for cert renewal.
+ # Add post-renewal tasks via systemd unit drop-in
FP_RENEWAL='/etc/systemd/system/certbot.service.d'
- # On Jessie- we install the CertBot from GitHub directly and add a cron job for renewal.
- (( $G_DISTRO < 4 )) && FP_RENEWAL='/etc/cron.weekly/dietpi-letsencrypt'
-
- FP_BINARY='/usr/bin/certbot'
- (( $G_DISTRO < 4 )) && FP_BINARY='/etc/certbot_scripts/certbot-auto'
-
- [[ -f $FP_BINARY ]] && LETSENCRYPT_INSTALLED=1 || LETSENCRYPT_INSTALLED=0
- LETSENCRYPT_DOMAIN='mydomain.com'
- LETSENCRYPT_EMAIL='myemail@email.com'
+ LETSENCRYPT_DOMAIN='mydomain.org'
+ LETSENCRYPT_EMAIL='myemail@email.org'
LETSENCRYPT_REDIRECT=0
LETSENCRYPT_HSTS=0
LETSENCRYPT_KEYSIZE=4096
@@ -74,21 +66,21 @@
# - Cert me up Apache2
# If cert exists already, attempt renewal. This allows easy configuration update via "dietpi-letsencrypt 1" without using up limited certs per week.
- if [[ -f $fp_cert_dir/cert.pem ]]; then
+ if [[ -f $fp_cert_dir'/cert.pem' ]]; then
- $FP_BINARY renew
+ certbot renew
local exit_code=$?
else
- $FP_BINARY $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
+ certbot $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
local exit_code=$?
fi
if (( $exit_code )); then
- echo "[FAILED] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..." | tee "$FP_LOGFILE"
- (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..."
+ echo "[FAILED] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..." | tee $FP_LOGFILE
+ (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..."
return 1
fi
@@ -100,46 +92,42 @@
G_DIETPI-NOTIFY 0 'Lighttpd webserver detected'
# - Cert me up
- if [[ -f $fp_cert_dir/cert.pem ]]; then
+ if [[ -f $fp_cert_dir'/cert.pem' ]]; then
- $FP_BINARY renew
+ certbot renew
local exit_code=$?
else
- $FP_BINARY certonly --webroot -w /var/www --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
+ certbot certonly --webroot -w /var/www --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
local exit_code=$?
fi
if (( $exit_code )); then
- echo "[FAILED] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..." | tee "$FP_LOGFILE"
- (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..."
+ echo "[FAILED] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..." | tee $FP_LOGFILE
+ (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..."
return 1
fi
# - Create combined key
cat "$fp_cert_dir/privkey.pem" "$fp_cert_dir/cert.pem" > "$fp_cert_dir/combined.pem"
- if [[ ! -f $fp_cert_dir/combined.pem ]]; then
+ if [[ ! -f $fp_cert_dir'/combined.pem' ]]; then
- echo "[FAILED] $fp_cert_dir/combined.pem could not be created. Please check existence of privkey.pem and cert.pem within this folder, as result of CertBot execution. Aborting..." | tee "$FP_LOGFILE"
+ echo "[FAILED] $fp_cert_dir/combined.pem could not be created. Please check existence of privkey.pem and cert.pem within this folder, as result of CertBot execution. Aborting..." | tee $FP_LOGFILE
(( $INPUT )) || G_WHIP_MSG "[FAILED] $fp_cert_dir/combined.pem could not be created. Please check existence of privkey.pem and cert.pem within this folder, as result of CertBot execution. Aborting..."
return 1
fi
# - Add Lighttpd renewal to certbot systemd service
- if (( $G_DISTRO > 3 )); then
-
- [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL"
- cat << _EOF_ > "$FP_RENEWAL"/dietpi-lighttpd.conf
+ [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL"
+ cat << _EOF_ > "$FP_RENEWAL"/dietpi-lighttpd.conf
[Service]
ExecStartPost=/bin/dash -c 'cat "$fp_cert_dir/privkey.pem" "$fp_cert_dir/cert.pem" > "$fp_cert_dir/combined.pem"'
_EOF_
- fi
-
# - Allow adding environment variables via: setenv.add-environment
G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
@@ -176,7 +164,7 @@ _EOF_
(( $G_DISTRO > 4 )) && sed -i '1i\server.modules += ( "mod_openssl" )\n' /etc/lighttpd/conf-enabled/letsencrypt.conf
# - Redirect
- [[ -f /etc/lighttpd/conf-enabled/redirect.conf ]] && rm /etc/lighttpd/conf-enabled/redirect.conf
+ [[ -f '/etc/lighttpd/conf-enabled/redirect.conf' ]] && rm /etc/lighttpd/conf-enabled/redirect.conf
if (( $LETSENCRYPT_REDIRECT )); then
cat << _EOF_ > /etc/lighttpd/conf-enabled/redirect.conf
@@ -201,7 +189,7 @@ _EOF_
_EOF_
lighttpd-enable-mod dietpi-hsts
- elif [[ -f /etc/lighttpd/conf-available/99-dietpi-hsts.conf ]]; then
+ elif [[ -f '/etc/lighttpd/conf-available/99-dietpi-hsts.conf' ]]; then
lighttpd-disable-mod dietpi-hsts
rm /etc/lighttpd/conf-available/99-dietpi-hsts.conf
@@ -219,28 +207,28 @@ _EOF_
G_CONFIG_INJECT 'server_name[[:blank:]]' " server_name $LETSENCRYPT_DOMAIN;" "$fp_defaultsite" 'listen[[:blank:]]'
# - Restart Nginx to apply server_name change
- systemctl restart nginx
+ G_RUN_CMD systemctl restart nginx
local options='--nginx'
(( $LETSENCRYPT_REDIRECT )) && options+=' --redirect' || options+=' --no-redirect'
(( $LETSENCRYPT_HSTS )) && options+=' --hsts'
# - Cert me up Nginx
- if [[ -f $fp_cert_dir/cert.pem ]]; then
+ if [[ -f $fp_cert_dir'/cert.pem' ]]; then
- $FP_BINARY renew
+ certbot renew
local exit_code=$?
else
- $FP_BINARY $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
+ certbot $options --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
local exit_code=$?
fi
if (( $exit_code )); then
- echo "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..." | tee "$FP_LOGFILE"
- (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..."
+ echo "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..." | tee $FP_LOGFILE
+ (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..."
return 1
fi
@@ -248,8 +236,8 @@ _EOF_
# - Apply HSTS header to ownCloud/Nextcloud config
if (( $LETSENCRYPT_HSTS )); then
- [[ -f /etc/nginx/sites-dietpi/dietpi-owncloud.conf ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' /etc/nginx/sites-dietpi/dietpi-owncloud.conf
- [[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf
+ [[ -f '/etc/nginx/sites-dietpi/dietpi-owncloud.conf' ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' /etc/nginx/sites-dietpi/dietpi-owncloud.conf
+ [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] && sed -i 's/#add_header Strict-Transport-Security/add_header Strict-Transport-Security/g' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf
fi
@@ -261,21 +249,21 @@ _EOF_
# - Cert me up
/DietPi/dietpi/dietpi-services stop
- if [[ -f $fp_cert_dir/cert.pem ]]; then
+ if [[ -f $fp_cert_dir'/cert.pem' ]]; then
- $FP_BINARY renew
+ certbot renew
local exit_code=$?
else
- $FP_BINARY certonly --standalone --staple-ocsp --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
+ certbot certonly --standalone --staple-ocsp --agree-tos --no-eff-email --rsa-key-size "$LETSENCRYPT_KEYSIZE" -m "$LETSENCRYPT_EMAIL" -d "$LETSENCRYPT_DOMAIN"
local exit_code=$?
fi
if (( $exit_code )); then
- echo "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..." | tee "$FP_LOGFILE"
- (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check it's terminal output. Aborting..."
+ echo "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..." | tee $FP_LOGFILE
+ (( $INPUT )) || G_WHIP_MSG "[FAILURE] CertBot failed with error code ($exit_code), please check its terminal output. Aborting..."
return 1
fi
@@ -325,22 +313,19 @@ _EOF_
# - Change permissions on renewal script
G_RUN_CMD chmod +x /home/minio-user/.minio/dietpi-cert-renewl.sh
- # Add Minio renewal to certbot system service
- if (( $G_DISTRO > 3 )); then
-
- [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL"
- cat << _EOF_ > "$FP_RENEWAL"/dietpi-minio.conf
+ # - Add Minio renewal to certbot system service
+ [[ -d $FP_RENEWAL ]] || mkdir "$FP_RENEWAL"
+ cat << _EOF_ > "$FP_RENEWAL"/dietpi-minio.conf
[Service]
ExecStartPost=/home/minio-user/.minio/dietpi-cert-renewl.sh &>> $FP_LOGFILE
_EOF_
- fi
-
- echo '[ INFO ] HTTPS redirect and HSTS is not supported for Minio, thus will be ignored.' | tee "$FP_LOGFILE"
+ # - Inform user that HTTPS redirect and HSTS is not supported for Minio, if chosen
+ (( $LETSENCRYPT_REDIRECT || $LETSENCRYPT_HSTS )) && echo '[ INFO ] HTTPS redirect and HSTS is not supported for Minio, thus will be ignored.' | tee $FP_LOGFILE
else
- echo '[FAILURE] No compatible and/or active webserver was found. Aborting...' | tee "$FP_LOGFILE"
+ echo '[FAILURE] No compatible and/or active webserver was found. Aborting...' | tee $FP_LOGFILE
(( $INPUT )) || G_WHIP_YESNO '[FAILURE] No compatible and/or active webserver was found.\n
Currently DietPi-LetsEncrypt configures the following web applications:
- Apache2 (webserver)
@@ -352,50 +337,16 @@ Would you like to switch to DietPi-Software, to install one of the above?' && /D
fi
- # ALL | Create cert renewal cron job on Jessie-:
- if (( $G_DISTRO < 4 )); then
-
- cat << _EOF_ > "$FP_RENEWAL"
-#!/bin/bash
-{
- #////////////////////////////////////
- # DietPi-LetsEncrypt Autorenew script
- #
- #////////////////////////////////////
- #
- # Info:
- # - Location $FP_RENEWAL
- #
- #////////////////////////////////////
-
- #----------------------------------------------------------------
- # Main Loop
- #----------------------------------------------------------------
-
- $FP_BINARY -q renew &>> $FP_LOGFILE
- [[ -f /home/minio-user/.minio/dietpi-cert-renewl.sh ]] && /home/minio-user/.minio/dietpi-cert-renewl.sh &>> $FP_LOGFILE
- [[ -f $fp_cert_dir/combined.pem ]] && cat "$fp_cert_dir/privkey.pem" "$fp_cert_dir/cert.pem" > "$fp_cert_dir/combined.pem" 2>> $FP_LOGFILE
-
- #----------------------------------------------------------------
- exit
- #----------------------------------------------------------------
-}
-_EOF_
- G_RUN_CMD chmod +x "$FP_RENEWAL"
-
- else
-
- systemctl daemon-reload
-
- fi
+ # ALL | Relead systemd daemon to apply unit changes
+ systemctl daemon-reload
#------------------------------------------------------------------------------------------------------
if (( ! $INPUT )); then
- echo ''
- read -p 'Press any key to continue...'
- echo ''
+ read -p '
+Press any key to continue...
+'
fi
@@ -437,17 +388,7 @@ _EOF_
Menu_Exit(){
G_WHIP_SIZE_X_MAX=50
- if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then
-
- # Exit
- TARGETMENUID=-1
-
- else
-
- # Return to Main Menu
- TARGETMENUID=0
-
- fi
+ G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 # Exit
}
@@ -457,20 +398,13 @@ _EOF_
local input_desc=$2
G_WHIP_DEFAULT_ITEM=$input_value
- if G_WHIP_INPUTBOX "Please enter a value for $input_desc"; then
-
- input_value=$G_WHIP_RETURNED_VALUE
+ G_WHIP_INPUTBOX "Please enter a value for $input_desc" || return 1
- # Prevent null values
- [[ $input_value ]] || input_value='NULL'
-
- fi
-
- echo "$input_value"
+ echo "${G_WHIP_RETURNED_VALUE:-NULL}"
}
- #TARGETMENUID=0
+ # TARGETMENUID=0
Menu_Main(){
local hsts_text='[Off] | No HTTP Strict Transport Security'
@@ -481,12 +415,12 @@ _EOF_
G_WHIP_MENU_ARRAY=(
- 'Domain' ": $LETSENCRYPT_DOMAIN"
- 'Email' ": $LETSENCRYPT_EMAIL"
+ 'Domain' ": [$LETSENCRYPT_DOMAIN]"
+ 'Email' ": [$LETSENCRYPT_EMAIL]"
'Redirect' ": $redirect_text"
'HSTS' ": $hsts_text"
- 'Key Size' ": $LETSENCRYPT_KEYSIZE"
- 'Apply' 'Runs Lets Encrypt with your chosen options.'
+ 'Key Size' ": [$LETSENCRYPT_KEYSIZE bits]"
+ 'Apply' ': Runs CertBot with your chosen options'
)
@@ -500,13 +434,23 @@ _EOF_
'Domain')
- while :
+ local new=$LETSENCRYPT_DOMAIN
+ local error=''
+ while new=$(Input_Box "$new" "Website-Domain$error")
do
- LETSENCRYPT_DOMAIN=$(Input_Box "$LETSENCRYPT_DOMAIN" Website-Domain)
- [[ $LETSENCRYPT_DOMAIN == *?.?* && ! $(sed 's/\.//g' <<< "$LETSENCRYPT_DOMAIN") =~ ^[0-9]*$ ]] && break
+ # Must contain at least one dot with leading secondary domain and trailing top domain
+ # Must not be an IP address with integers and dots only
+ if [[ $new == *?.?* && $new == *[^0-9.]* ]]; then
+
+ LETSENCRYPT_DOMAIN=$new
+ break
- G_WHIP_MSG "[FAILED] \"$LETSENCRYPT_DOMAIN\" is no valid domain name.\n\nNote that raw IP addresses are not allowed by LetsEncrypt, thus a domain is required.\nYou can install No-IP with DietPi-Software to aquire one.\n\nPlease try again..."
+ else
+
+ error="\n\n[FAILED] \"$new\" is no valid domain name.\n\nNote that raw IP addresses are not allowed by Let's Encrypt, thus a domain is required.\nYou can install No-IP with DietPi-Software to aquire one.\n\nPlease retry..."
+
+ fi
done
@@ -534,19 +478,15 @@ _EOF_
G_WHIP_YESNO 'HTTP Strict Transport Security (HSTS)\n
Carefully read the following, before enabling this feature:
-
-HSTS will make your browser remember that it accessed your domain/IP via HTTPS for one or half a year.
+\nHSTS will make your browser remember that it accessed your domain/IP via HTTPS for one or half a year.
From then on, it will always access the same domain/IP via HTTPS, denying all HTTP access attempts.
This increases security in addition to encrypted traffic, as noone can silently redirect you to a fake web page.
HTTPS forces web pages to verify their identity via the HTTPS certificate, which cannot be faked in a reasonable time.
-
-The downside is, your browser will deny access to all non-HTTPS web applications behind the same domain/IP.
+\nThe downside is, your browser will deny access to all non-HTTPS web applications behind the same domain/IP.
EG: "Sonarr" uses a standalone web server contained within the application. This uses a custom port, which can be recognized as you need to add a non-default port to your IP/domain to access it: "192.168.0.100:8989".
Enabling HSTS will prevent access to applications which use a standalone webserver.
-
-It is possible to enable HTTPS support for standalone web servers, however, you will need to research and achieve this manually.
-
-Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENCRYPT_HSTS=1
+\nIt is possible to enable HTTPS support for standalone web servers, however, you will need to research and achieve this manually.
+\nAre you sure that you want to enable HTTP Strict Transport Security?' && LETSENCRYPT_HSTS=1
fi
@@ -560,13 +500,13 @@ Are you sure that you want to enable HTTP Strict Transport Security?' && LETSENC
'Apply')
- if G_WHIP_YESNO 'LetsEncrypt will now be run. This will:
-- Create your free SSL cert.
-- Automatically apply and enable your SSL cert
+ if G_WHIP_YESNO 'CertBot will now run, which will:
+- Create your free SSL certificate
+- Automatically apply your SSL certificate to the webserver
+- Enable HTTPS for all web applications which use "/var/www/"
- NB: This process can take a long time, please be patient.
-- NB: HTTPS will automatically be applied to the webserver and applications which use "/var/www/*".
- Applications which use their own webserver (these usually have their own :port number), will not be available under HTTPS, and, these will need to be configured manually.\n
-Would you like to continue?'; then
+ This does not apply to applications which use their own webserver, which usually have their own :port number. These will need to be configured manually.
+\nWould you like to continue?'; then
Write_Settings_File
Run_Lets_Encrypt
@@ -580,7 +520,6 @@ Would you like to continue?'; then
else
- # Exit
Menu_Exit
fi
@@ -603,30 +542,32 @@ Would you like to continue?'; then
#-----------------------------------------------------------------------------------
# Check installed
- if (( ! $LETSENCRYPT_INSTALLED )); then
+ until command -v certbot &> /dev/null
+ do
# Menu
- if (( ! $INPUT )); then
+ if (( ! $INPUT )) && G_WHIP_YESNO '[WARNING] No CertBot binary found\n
+Would you like to install CertBot now via "dietpi-software"?'; then
- G_DIETPI-NOTIFY 1 "CertBot binary not found ( $FP_BINARY )"
- G_DIETPI-NOTIFY 2 'Please install CertBot with DietPi-Software before running this program.'
- read -p 'Press any key to continue.....'
+ /DietPi/dietpi/dietpi-software install 92
else
- echo "[FAILURE] CertBot binary not found ( $FP_BINARY ), please install it with DietPi-Software. Aborting..." | tee "$FP_LOGFILE"
+ echo '[FAILURE] No CertBot binary found, please install it with "dietpi-software". Aborting...' | tee $FP_LOGFILE
+ exit 1
fi
+ done
+
#-----------------------------------------------------------------------------------
# Menu
- elif (( ! $INPUT )); then
+ if (( ! $INPUT )); then
while (( $TARGETMENUID > -1 )); do
printf '\ec' # clear current terminal screen
-
- (( $TARGETMENUID == 0 )) && Menu_Main
+ Menu_Main
done
@@ -639,9 +580,8 @@ Would you like to continue?'; then
else
- G_DIETPI-NOTIFY 2 'DietPi-LetsEncrypt usage:'
- G_DIETPI-NOTIFY 2 ' dietpi-letsencrypt => Open whiptail menu'
- G_DIETPI-NOTIFY 2 ' dietpi-letsencrypt 1 => Create/Renew/Apply certs non-interactively'
+ G_DIETPI-NOTIFY 1 "Invalid input argument
+\n$USAGE"
fi
diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login
index d02a73a512..ed52175716 100644
--- a/dietpi/dietpi-login
+++ b/dietpi/dietpi-login
@@ -9,14 +9,10 @@
#////////////////////////////////////
#
# Info:
- # - Filename: /DietPi/dietpi/dietpi-login
+ # - Filename: /{DietPi,boot}/dietpi/dietpi-login
# - Called in interactive bash shells from: /etc/bashrc.d/dietpi.bash
#////////////////////////////////////
- # Import DietPi-Globals --------------------------------------------------------------
- # In main loop
- # Import DietPi-Globals --------------------------------------------------------------
-
#/////////////////////////////////////////////////////////////////////////////////////
# Globals
#/////////////////////////////////////////////////////////////////////////////////////
@@ -25,7 +21,7 @@
Show_License(){
- if [[ -f '/var/lib/dietpi/license.txt' ]] && (( $G_USER_INPUTS )); then
+ if [[ -f '/var/lib/dietpi/license.txt' ]] && (( $G_INTERACTIVE )); then
G_WHIP_VIEWFILE /var/lib/dietpi/license.txt
rm /var/lib/dietpi/license.txt
@@ -112,17 +108,17 @@
# First Run Setup
Run_DietPi_First_Run_Setup(){
- # - Set non-interactive shell if automated install chosen, as .bashrc run via STDIN check is interactive
- grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && export G_USER_INPUTS=0
+ # - Set non-interactive if automated firstrun setup has been chosen
+ grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && export G_INTERACTIVE=0
# - Prompt and wait if this script runs in other session already
- local pid_firstrunsetup=''
+ local pid_firstrunsetup
[[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && pid_firstrunsetup=$(<$FP_DIETPI_FIRSTRUNSETUP_PID)
if [[ $pid_firstrunsetup && $pid_firstrunsetup != $$ ]]; then
# - First run setup running in other session
local additional_text='Please resume setup on the active screen.'
- (( $G_USER_INPUTS )) || additional_text='Automated setup is in progress. When completed, the system will be rebooted.'
+ [[ $G_INTERACTIVE == 0 ]] && additional_text='Automated setup is in progress. When completed, the system will be rebooted.'
G_WHIP_MSG "[INFO] DietPi first run setup: Currently running on another screen (PID=$pid_firstrunsetup).\n\n$additional_text"
@@ -143,6 +139,8 @@ Please login again as user "root" with password "dietpi", respectively the one y
# Prevent re-run from another session.
echo $$ > $FP_DIETPI_FIRSTRUNSETUP_PID
+ # - Always remove PID file when script is killed
+ trap '[[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID' EXIT
Show_License
@@ -162,10 +160,10 @@ Please login again as user "root" with password "dietpi", respectively the one y
elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then
# - Start DietPi-Software
+ export G_WHIP_SIZE_X_OVERRIDE=$(tput cols)
+ export G_WHIP_SIZE_Y_OVERRIDE=$(tput lines)
/DietPi/dietpi/dietpi-software 2>&1 | tee $FP_DIETPI_FIRSTRUNSETUP_LOG # Sets G_DIETPI_INSTALL_STAGE=2
-
- # - Done
- [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID
+ unset G_WHIP_SIZE_X_OVERRIDE G_WHIP_SIZE_Y_OVERRIDE
fi
@@ -192,8 +190,6 @@ Please login again as user "root" with password "dietpi", respectively the one y
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Login'
#G_INIT # To allow concurrent logins
- # - Always remove PID file when script is killed
- trap '[[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID' EXIT
# Import DietPi-Globals --------------------------------------------------------------
/DietPi/dietpi/func/obtain_network_details
@@ -214,7 +210,7 @@ Please login again as user "root" with password "dietpi", respectively the one y
#----------------------------------------------------------------
# Run DietPi-Update/DietPi-Software (1st run setup) (G_DIETPI_INSTALL_STAGE=0/1)
- elif (( $G_DIETPI_INSTALL_STAGE == 0 || $G_DIETPI_INSTALL_STAGE == 1 )); then
+ elif [[ $G_DIETPI_INSTALL_STAGE == [01] ]]; then
/DietPi/dietpi/func/dietpi-banner 0
@@ -228,7 +224,7 @@ Please login again as user "root" with password "dietpi", respectively the one y
# - Force interactive mode to show G_WHIP error prompts
# NB: We need to write this to dietpi.txt as well to not have this overwritten on next loop.
- export G_USER_INPUTS=1
+ export G_INTERACTIVE=1
G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=0' /DietPi/dietpi.txt
if G_WHIP_DEFAULT_ITEM='yes' G_WHIP_YESNO "[FAILED] Unknown install state/First run setup failed\n
@@ -240,7 +236,6 @@ Would you like to restart the first run setup and installation?"; then
# - Reset and force re-run of first run
killall -qw dietpi-software dietpi-update
echo 0 > /DietPi/dietpi/.install_stage
- [[ -f $FP_DIETPI_FIRSTRUNSETUP_PID ]] && rm $FP_DIETPI_FIRSTRUNSETUP_PID
else
diff --git a/dietpi/dietpi-morsecode b/dietpi/dietpi-morsecode
index eed1fd491d..d534613128 100644
--- a/dietpi/dietpi-morsecode
+++ b/dietpi/dietpi-morsecode
@@ -88,7 +88,6 @@
fi
}
-
#/////////////////////////////////////////////////////////////////////////////////////
# Morse Code Data
#/////////////////////////////////////////////////////////////////////////////////////
diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services
index 81147ac86d..a49ab2fc6b 100644
--- a/dietpi/dietpi-services
+++ b/dietpi/dietpi-services
@@ -33,9 +33,8 @@ Available services:
# Grab Inputs
INPUT_CMD=$1
- INPUT_SERVICE=$2
- # - pre-v6.25 compatibility
- [[ $INPUT_SERVICE == 'all' ]] && unset INPUT_SERVICE
+ # - pre-v6.25 compatibility: all =>
+ [[ $2 && $2 != 'all' ]] && INPUT_SERVICE=$2
# - Optional env vars to prevent service control
[[ $G_DIETPI_SERVICES_DISABLE == 1 ]] && exit 0
@@ -57,7 +56,6 @@ Available services:
# Core ---------------------------------------------------------------
# - Network
- 'fail2ban'
'avahi-daemon'
'isc-dhcp-server'
'haproxy'
@@ -73,7 +71,6 @@ Available services:
# - Databases
'redis-server'
'mariadb'
- #'mysql' # Applied on Jessie systems during availability check: https://github.com/MichaIng/DietPi/issues/1000#issuecomment-30776051
# - PHP
'php5-fpm'
@@ -210,15 +207,16 @@ Available services:
aSERVICE_NAME+=('ssh') # OpenSSH Server
# - Misc
+ aSERVICE_NAME+=('fail2ban') # Brute-force protection, which should not be stopped during updates/installs etc
#aSERVICE_NAME+=('systemd-timesyncd') # Network time sync: DietPi stops this by default after success, may confuse user/prompt questions.
- aSERVICE_NAME+=('dnsmasq') # https://github.com/MichaIng/DietPi/issues/1501
+ aSERVICE_NAME+=('dnsmasq') # https://github.com/MichaIng/DietPi/issues/1501
aSERVICE_NAME+=('pihole-FTL') # https://github.com/MichaIng/DietPi/issues/1696
aSERVICE_NAME+=('openvpn') # https://github.com/MichaIng/DietPi/issues/1501
- aSERVICE_NAME+=('vncserver') # DietPi VNC Server
- aSERVICE_NAME+=('nxserver') # NoMachine Server
+ aSERVICE_NAME+=('vncserver') # DietPi VNC Server
+ aSERVICE_NAME+=('nxserver') # NoMachine Server
aSERVICE_NAME+=('xrdp') # XRDP Server
- aSERVICE_NAME+=('amiberry') # DietPi Amiberry service
- #aSERVICE_NAME+=('wg-quick@wg0') # WireGuard: Currently instantiated services are not supported
+ aSERVICE_NAME+=('amiberry') # DietPi Amiberry service
+ #aSERVICE_NAME+=('wg-quick@wg0') # WireGuard: Currently instantiated services are not supported
# - DietPi
aSERVICE_NAME+=('dietpi-nordvpn') # NordVPN install + client
@@ -332,9 +330,6 @@ _EOF_
[[ ${aSERVICE_NAME[$i]} ]] || { unset aSERVICE_NAME[$i]; continue; } # Failsafe
- # Below Stretch, "mariadb" systemd service does not exist, thus "mysql" init.d service will be used.
- (( $G_DISTRO < 4 )) && [[ ${aSERVICE_NAME[$i]} == 'mariadb' ]] && aSERVICE_NAME[$i]='mysql'
-
for j in /{etc,lib,usr/lib}/systemd/system/"${aSERVICE_NAME[$i]}.service" /etc/init.d/"${aSERVICE_NAME[$i]}"
do
@@ -358,12 +353,12 @@ _EOF_
}
# $1 = command
- # $2 = service
+ # $2 = service name
# $3 = exit code
Print_Status(){ G_DIETPI-NOTIFY ${3/[^0]*/1} "$1 : $2"; }
# $1 = command (start/stop/restart)
- # $2 = index (optional)
+ # $2 = service index (optional)
Set_Running_State(){
local command=${1,,}
@@ -396,8 +391,8 @@ _EOF_
# Enable ownCloud and Nextcloud maintenance mode before all services being stopped or restarted
if [[ $command == 'stop' || $command == 'restart' && ! $index ]]; then
- [[ -f '/var/www/owncloud/config/config.php' ]] && grep -q "'maintenance' => false," /var/www/owncloud/config/config.php && G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD occ maintenance:mode --on
- [[ -f '/var/www/nextcloud/config/config.php' ]] && grep -q "'maintenance' => false," /var/www/nextcloud/config/config.php && G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD ncc maintenance:mode --on
+ [[ -f '/var/www/owncloud/config/config.php' ]] && grep -q "'maintenance' => false," /var/www/owncloud/config/config.php && G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD occ maintenance:mode --on
+ [[ -f '/var/www/nextcloud/config/config.php' ]] && grep -q "'maintenance' => false," /var/www/nextcloud/config/config.php && G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD ncc maintenance:mode --on
fi
@@ -415,15 +410,15 @@ _EOF_
# Disable ownCloud and Nextcloud maintenance mode after all services being started or restarted
if [[ $command == 'start' || $command == 'restart' && ! $index ]]; then
- [[ -f '/var/www/owncloud/config/config.php' ]] && grep -q "'maintenance' => true," /var/www/owncloud/config/config.php && G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD occ maintenance:mode --off
- [[ -f '/var/www/nextcloud/config/config.php' ]] && grep -q "'maintenance' => true," /var/www/nextcloud/config/config.php && G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD ncc maintenance:mode --off
+ [[ -f '/var/www/owncloud/config/config.php' ]] && grep -q "'maintenance' => true," /var/www/owncloud/config/config.php && G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD occ maintenance:mode --off
+ [[ -f '/var/www/nextcloud/config/config.php' ]] && grep -q "'maintenance' => true," /var/www/nextcloud/config/config.php && G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD ncc maintenance:mode --off
fi
}
# $1 = command
- # $2 = index (optional)
+ # $2 = service index (optional)
Apply_Service_State(){
local command=${1,,}
@@ -513,7 +508,7 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Process Tool
#/////////////////////////////////////////////////////////////////////////////////////
- # $1=index
+ # $1 = service index
Prepare_Service_Dropin(){
local index=$1
@@ -544,9 +539,9 @@ If you experience any issues with the wrapper, remove the file, reload and resta
}
- # $1=index
- # $2=setting (reset=reset ALL settings, 0=CPUAffinity, 1=CPUSchedulingPolicy, 2=Nice, 3=CPUSchedulingPriority, 4=IOSchedulingClass, 5=IOSchedulingPriority)
- # $3=value (reset=reset $2 setting)
+ # $1 = service index
+ # $2 = setting (reset=reset ALL settings, 0=CPUAffinity, 1=CPUSchedulingPolicy, 2=Nice, 3=CPUSchedulingPriority, 4=IOSchedulingClass, 5=IOSchedulingPriority)
+ # $3 = value (reset=reset $2 setting)
FP_PROCESS_TOOL_CONF='dietpi-process_tool.conf'
Apply_Process_Tool(){
@@ -602,7 +597,7 @@ If you experience any issues with the wrapper, remove the file, reload and resta
}
- # $1=index
+ # $1 = service index
Load_Process_Tool(){
local index=$1
@@ -648,7 +643,7 @@ If you experience any issues with the wrapper, remove the file, reload and resta
do
aSERVICE_MODE[$i]=$(systemctl is-enabled "${aSERVICE_NAME[$i]}" 2> /dev/null)
- Load_Process_Tool $i
+ Load_Process_Tool $i
done
@@ -1282,7 +1277,7 @@ NB: This only has an effect on drives handled by the CFQ scheduler."; then
[[ $INPUT_SERVICE && ! ${aSERVICE_NAME[0]} ]] && { G_DIETPI-NOTIFY 1 "Service ($INPUT_SERVICE) could not be found."; exit 1; }
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_CMD $INPUT_SERVICE"
- Apply_Service_State $INPUT_CMD $INPUT_SERVICE
+ Apply_Service_State $INPUT_CMD ${INPUT_SERVICE+0} # Load_Service_Array will add INPUT_SERVICE as index 0, if given
#-----------------------------------------------------------------------------------
# Men You!
@@ -1293,13 +1288,13 @@ NB: This only has an effect on drives handled by the CFQ scheduler."; then
while (( $MENU_TARGETID > -1 ))
do
- if (( $MENU_TARGETID == 0 )); then
+ if (( $MENU_TARGETID == 1 )); then
- Menu_Main
+ Menu_Service
- elif (( $MENU_TARGETID == 1 )); then
+ else
- Menu_Service
+ Menu_Main
fi
diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software
index eabc16b4d9..6350ae122a 100644
--- a/dietpi/dietpi-software
+++ b/dietpi/dietpi-software
@@ -9,7 +9,7 @@
#////////////////////////////////////
#
# Info:
- # - Location: /DietPi/dietpi/dietpi-software
+ # - Location: /{DietPi,boot}/dietpi/dietpi-software
# - Installs "ready to run" software with optimisations unique to the device.
# - Generates and uses /DietPi/dietpi/.installed (software list) # -1=selected for uninstall, 0=not installed, 1=selected for install, 2=installed
#
@@ -59,7 +59,7 @@
> $fp_target
# Save installed states
- for i in ${!aSOFTWARE_INSTALL_STATE[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
# - Never save pending state for software (=1). Excluding temp saves.
@@ -154,11 +154,11 @@ _EOF_
GLOBAL_PW=''
- # - Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213
+ # Use new "pbkdf2" function on Buster to resolve warning about deprecated key derivation used: https://github.com/MichaIng/DietPi/issues/2213
local pbkdf2
(( $G_DISTRO > 4 )) && pbkdf2='-iter 10000'
- # - Encrypted
+ # Read encrypted password
if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then
GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin)
@@ -170,12 +170,11 @@ _EOF_
fi
- # - 1st run automated setup or user cancelled manual password choice
- elif GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//'); then
+ # If encryption has not yet been done, do it now!
+ elif GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt); then
G_CONFIG_INJECT 'AUTO_SETUP_GLOBAL_PASSWORD=' 'AUTO_SETUP_GLOBAL_PASSWORD=Password has been encrypted and secured on rootFS' /DietPi/dietpi.txt
openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW
- chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
[[ $GLOBAL_PW != 'dietpi' ]] && G_WHIP_MSG '[ INFO ] For security reasons your global software password has been removed from dietpi.txt and instead ecrypted and saved to:
- /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin\n
DietPi-Software will decrypt and use it for software installs. You can change it via:
@@ -183,7 +182,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
fi
- # - Failsafe
+ # Apply safe permissions
+ chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
+ chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
+
+ # Failsafe
if [[ ! $GLOBAL_PW ]]; then
GLOBAL_PW='dietpi'
@@ -208,15 +211,13 @@ DietPi-Software will decrypt and use it for software installs. You can change it
USER_EMONHUB_APIKEY_COMPLETED=0
USER_EMONHUB_APIKEY_CURRENT=0
WIFIHOTSPOT_RTL8188C_DEVICE=0
+ WIFIHOTSPOT_RTL8188C_PACKAGE=0
USER_LINUX_AUTOINSTALL_PROMPT_DISPLAYED=0
# PHP version specific directories, APT package-, module- and command names
# - and distro specific MariaDB service name
FP_PHP_BASE_DIR='/etc/php/7.3'
PHP_NAME='php7.3'
- # MariaDB: On Jessie it is still shipped with /etc/init.d/mysql only
- MARIADB_SERVICE='mariadb'
- (( $G_DISTRO < 4 )) && MARIADB_SERVICE='mysql'
USBDRIVE=0
@@ -251,7 +252,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
# Available for (need to match highest value in dietpi-obtain_hw_model)
MAX_G_HW_MODEL=72
MAX_G_HW_ARCH=10
- MAX_G_DISTRO=5
+ MAX_G_DISTRO=6
# - 2D array (well, bash style)
declare -A aSOFTWARE_AVAIL_G_HW_MODEL
declare -A aSOFTWARE_AVAIL_G_HW_ARCH
@@ -320,87 +321,79 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=23
- aSOFTWARE_WHIP_NAME[$software_id]='LXDE'
- aSOFTWARE_WHIP_DESC[$software_id]='ultra lightweight desktop'
+ aSOFTWARE_NAME[$software_id]='LXDE'
+ aSOFTWARE_DESC[$software_id]='ultra lightweight desktop'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=42#p42'
-
#------------------
software_id=173
- aSOFTWARE_WHIP_NAME[$software_id]='LXQt'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop'
+ aSOFTWARE_NAME[$software_id]='LXQt'
+ aSOFTWARE_DESC[$software_id]='lightweight desktop'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17712#p17712'
-
#------------------
software_id=24
- aSOFTWARE_WHIP_NAME[$software_id]='MATE'
- aSOFTWARE_WHIP_DESC[$software_id]='desktop enviroment'
+ aSOFTWARE_NAME[$software_id]='MATE'
+ aSOFTWARE_DESC[$software_id]='desktop enviroment'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2073#p2073'
-
#------------------
software_id=25
- aSOFTWARE_WHIP_NAME[$software_id]='XFCE'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop'
+ aSOFTWARE_NAME[$software_id]='XFCE'
+ aSOFTWARE_DESC[$software_id]='lightweight desktop'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2203#p2203'
-
#------------------
software_id=26
- aSOFTWARE_WHIP_NAME[$software_id]='GNUStep'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight desktop based on OpenStep'
+ aSOFTWARE_NAME[$software_id]='GNUStep'
+ aSOFTWARE_DESC[$software_id]='lightweight desktop based on OpenStep'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2072#p2072'
-
#------------------
software_id=113
- aSOFTWARE_WHIP_NAME[$software_id]='Chromium'
- aSOFTWARE_WHIP_DESC[$software_id]='web browser for desktop or autostart'
+ aSOFTWARE_NAME[$software_id]='Chromium'
+ aSOFTWARE_DESC[$software_id]='web browser for desktop or autostart'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3011#p3011'
-
# - ARMv6
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
#------------------
software_id=174
- aSOFTWARE_WHIP_NAME[$software_id]='GIMP'
- aSOFTWARE_WHIP_DESC[$software_id]='mspaint on steroids'
+ aSOFTWARE_NAME[$software_id]='GIMP'
+ aSOFTWARE_DESC[$software_id]='mspaint on steroids'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=17713#p17713'
-
#------------------
software_id=175
- aSOFTWARE_WHIP_NAME[$software_id]='XFCE4 Power'
- aSOFTWARE_WHIP_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)'
+ aSOFTWARE_NAME[$software_id]='XFCE4 Power'
+ aSOFTWARE_DESC[$software_id]='power manager with brightness (recommended for LXDE/LXQt)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
@@ -408,67 +401,42 @@ DietPi-Software will decrypt and use it for software installs. You can change it
# Remote Desktops
#--------------------------------------------------------------------------------
- software_id=27
-
- aSOFTWARE_WHIP_NAME[$software_id]='TightVNC Server'
- aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=1
- aSOFTWARE_TYPE[$software_id]=0
- aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
- aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408'
-
- # - ARMv8
- aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
- # - Stretch+: Replaced by TigerVNC (VNC4)
- for ((i=4; i<=$MAX_G_DISTRO; i++))
- do
-
- aSOFTWARE_AVAIL_G_DISTRO[$software_id,$i]=0
-
- done
-
- #------------------
software_id=28
- aSOFTWARE_WHIP_NAME[$software_id]='VNC4 Server'
- aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection'
+ aSOFTWARE_NAME[$software_id]='TigerVNC Server'
+ aSOFTWARE_DESC[$software_id]='desktop for remote connection'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=408#p408'
-
#------------------
software_id=29
- aSOFTWARE_WHIP_NAME[$software_id]='XRDP'
- aSOFTWARE_WHIP_DESC[$software_id]='remote desktop protocol (rdp) server'
+ aSOFTWARE_NAME[$software_id]='XRDP'
+ aSOFTWARE_DESC[$software_id]='remote desktop protocol (rdp) server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2074#p2074'
-
#------------------
software_id=30
- aSOFTWARE_WHIP_NAME[$software_id]='NoMachine'
- aSOFTWARE_WHIP_DESC[$software_id]='multi-platform server and client access'
+ aSOFTWARE_NAME[$software_id]='NoMachine'
+ aSOFTWARE_DESC[$software_id]='multi-platform server and client access'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2071#p2071'
-
#------------------
software_id=120
- aSOFTWARE_WHIP_NAME[$software_id]='RealVNC Server'
- aSOFTWARE_WHIP_DESC[$software_id]='desktop for remote connection'
+ aSOFTWARE_NAME[$software_id]='RealVNC Server'
+ aSOFTWARE_DESC[$software_id]='desktop for remote connection'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4149#p4149'
-
- # - License RPi only
+ # RPi only (archive.raspberrypi.org repo)
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
@@ -480,132 +448,119 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=31
- aSOFTWARE_WHIP_NAME[$software_id]='Kodi'
- aSOFTWARE_WHIP_DESC[$software_id]='the media centre for linux'
+ aSOFTWARE_NAME[$software_id]='Kodi'
+ aSOFTWARE_DESC[$software_id]='the media centre for linux'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=43#p43'
-
- # - Only RPi + Odroid + x86_64
+ # Only RPi + Odroid + x86_64
for ((i=22; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
# + ASUS TB
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1
-
# - C1 Stretch
- (( $G_DISTRO > 3 )) & aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,10]=0
-
+ aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,10]=0
#------------------
software_id=32
- aSOFTWARE_WHIP_NAME[$software_id]='ympd'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight web interface music player for mpd'
+ aSOFTWARE_NAME[$software_id]='ympd'
+ aSOFTWARE_DESC[$software_id]='lightweight web interface music player for mpd'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=50#p50'
-
#------------------
software_id=148
- aSOFTWARE_WHIP_NAME[$software_id]='myMPD'
- aSOFTWARE_WHIP_DESC[$software_id]='fork of ympd with improved features'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=2
+ aSOFTWARE_NAME[$software_id]='myMPD'
+ aSOFTWARE_DESC[$software_id]='fork of ympd with improved features'
aSOFTWARE_TYPE[$software_id]=0
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=2
+ aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
- aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13978#p13978'
-
#------------------
software_id=119
- aSOFTWARE_WHIP_NAME[$software_id]='CAVA'
- aSOFTWARE_WHIP_DESC[$software_id]='optional: console audio vis for mpd'
+ aSOFTWARE_NAME[$software_id]='CAVA'
+ aSOFTWARE_DESC[$software_id]='optional: console audio vis for mpd'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3928#p3928'
-
#------------------
software_id=33
- aSOFTWARE_WHIP_NAME[$software_id]='Airsonic'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=2
+ aSOFTWARE_NAME[$software_id]='Airsonic'
+ aSOFTWARE_DESC[$software_id]='web interface media streaming server'
aSOFTWARE_TYPE[$software_id]=0
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=2
+ aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
- aSOFTWARE_ONLINEDOC_URL[$software_id]='p=11280#p11280'
-
# - Buster: https://github.com/MichaIng/DietPi/issues/2787
aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
-
+ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
#------------------
software_id=34
- aSOFTWARE_WHIP_NAME[$software_id]='Subsonic'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server'
+ aSOFTWARE_NAME[$software_id]='Subsonic'
+ aSOFTWARE_DESC[$software_id]='web interface media streaming server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=213#p213'
-
# - Buster: https://github.com/MichaIng/DietPi/issues/2787
aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
-
+ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
#------------------
software_id=35
- aSOFTWARE_WHIP_NAME[$software_id]='Logitech Media Server'
- aSOFTWARE_WHIP_DESC[$software_id]='aka LMS, Squeezebox Server'
+ aSOFTWARE_NAME[$software_id]='Logitech Media Server'
+ aSOFTWARE_DESC[$software_id]='aka LMS, Squeezebox Server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009'
-
#------------------
software_id=36
- aSOFTWARE_WHIP_NAME[$software_id]='SqueezeLite'
- aSOFTWARE_WHIP_DESC[$software_id]='audio player for lms & squeezebox'
+ aSOFTWARE_NAME[$software_id]='SqueezeLite'
+ aSOFTWARE_DESC[$software_id]='audio player for lms & squeezebox'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1009#p1009'
-
#------------------
software_id=37
- aSOFTWARE_WHIP_NAME[$software_id]='Shairport Sync'
- aSOFTWARE_WHIP_DESC[$software_id]='airplay audio player with multiroom sync'
+ aSOFTWARE_NAME[$software_id]='Shairport Sync'
+ aSOFTWARE_DESC[$software_id]='airplay audio player with multiroom sync'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1221#p1221'
-
#------------------
software_id=39
- aSOFTWARE_WHIP_NAME[$software_id]='ReadyMedia'
- aSOFTWARE_WHIP_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)'
+ aSOFTWARE_NAME[$software_id]='ReadyMedia'
+ aSOFTWARE_DESC[$software_id]='(MiniDLNA) media streaming server (dlna, upnp)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=49#p49'
-
#------------------
software_id=40
- aSOFTWARE_WHIP_NAME[$software_id]='Ampache'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server'
+ aSOFTWARE_NAME[$software_id]='Ampache'
+ aSOFTWARE_DESC[$software_id]='web interface media streaming server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
@@ -615,91 +570,77 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=554#p554'
-
#------------------
software_id=41
- aSOFTWARE_WHIP_NAME[$software_id]='Emby Server'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server'
+ aSOFTWARE_NAME[$software_id]='Emby Server'
+ aSOFTWARE_DESC[$software_id]='web interface media streaming server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1789#p1789'
-
# - ARMv6: https://github.com/MichaIng/DietPi/issues/534#issuecomment-416405968
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
- # - ARM on Jessie: https://github.com/MichaIng/DietPi/issues/2521
- (( $G_DISTRO < 4 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=0 && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
#------------------
software_id=42
- aSOFTWARE_WHIP_NAME[$software_id]='Plex Media Server'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface media streaming server'
+ aSOFTWARE_NAME[$software_id]='Plex Media Server'
+ aSOFTWARE_DESC[$software_id]='web interface media streaming server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1949#p1949'
-
# - ARMv6: https://github.com/MichaIng/DietPi/issues/648
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
#------------------
software_id=43
- aSOFTWARE_WHIP_NAME[$software_id]='Murmur'
- aSOFTWARE_WHIP_DESC[$software_id]='mumble voip server'
+ aSOFTWARE_NAME[$software_id]='Murmur'
+ aSOFTWARE_DESC[$software_id]='mumble voip server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1691#p1691'
-
#------------------
software_id=118
- aSOFTWARE_WHIP_NAME[$software_id]='Mopidy'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface music & radio player'
+ aSOFTWARE_NAME[$software_id]='Mopidy'
+ aSOFTWARE_DESC[$software_id]='web interface music & radio player'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3611#p3611'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
-
#------------------
software_id=121
- aSOFTWARE_WHIP_NAME[$software_id]='Roon Bridge'
- aSOFTWARE_WHIP_DESC[$software_id]='Turns device into Roon capable audio player'
+ aSOFTWARE_NAME[$software_id]='Roon Bridge'
+ aSOFTWARE_DESC[$software_id]='Turns device into Roon capable audio player'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4153#p4153'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
-
# - ARMv6
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
#------------------
software_id=124
- aSOFTWARE_WHIP_NAME[$software_id]='NAA daemon'
- aSOFTWARE_WHIP_DESC[$software_id]='signalyst network audio adaptor (naa)'
+ aSOFTWARE_NAME[$software_id]='NAA daemon'
+ aSOFTWARE_DESC[$software_id]='signalyst network audio adaptor (naa)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4294#p4294'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
-
#------------------
software_id=128
- aSOFTWARE_WHIP_NAME[$software_id]='MPD'
- aSOFTWARE_WHIP_DESC[$software_id]='music player daemon'
+ aSOFTWARE_NAME[$software_id]='MPD'
+ aSOFTWARE_DESC[$software_id]='music player daemon'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
#aSOFTWARE_ONLINEDOC_URL[$software_id]
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
-
#------------------
software_id=129
- aSOFTWARE_WHIP_NAME[$software_id]='O!MPD'
- aSOFTWARE_WHIP_DESC[$software_id]='feature-rich, web interface audio player for mpd'
+ aSOFTWARE_NAME[$software_id]='O!MPD'
+ aSOFTWARE_DESC[$software_id]='feature-rich, web interface audio player for mpd'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5171#p5171'
@@ -707,31 +648,27 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
-
#------------------
software_id=135
- aSOFTWARE_WHIP_NAME[$software_id]='IceCast'
- aSOFTWARE_WHIP_DESC[$software_id]='Shoutcast streaming server (+DarkIce)'
+ aSOFTWARE_NAME[$software_id]='IceCast'
+ aSOFTWARE_DESC[$software_id]='Shoutcast streaming server (+DarkIce)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6526#p6526'
-
# - VM
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0
-
#------------------
software_id=141
- aSOFTWARE_WHIP_NAME[$software_id]='Spotify Connect Web'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface for spotify premium'
+ aSOFTWARE_NAME[$software_id]='Spotify Connect Web'
+ aSOFTWARE_DESC[$software_id]='web interface for spotify premium'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7013#p7013'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
-
- # - ARMv7 only
+ # ARMv7 only
for ((i=1; i<=$MAX_G_HW_ARCH; i++))
do
@@ -739,12 +676,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
done
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,2]=1
-
#------------------
software_id=143
- aSOFTWARE_WHIP_NAME[$software_id]='Koel'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface audio streamer'
+ aSOFTWARE_NAME[$software_id]='Koel'
+ aSOFTWARE_DESC[$software_id]='web interface audio streamer'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7305#p7305'
@@ -755,29 +691,26 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
# Currently user prompt asks for admin user credentials
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
-
#------------------
software_id=146
- aSOFTWARE_WHIP_NAME[$software_id]='Tautulli'
- aSOFTWARE_WHIP_DESC[$software_id]='monitoring and tracking tool for Plex'
+ aSOFTWARE_NAME[$software_id]='Tautulli'
+ aSOFTWARE_DESC[$software_id]='monitoring and tracking tool for Plex'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7463#p7463'
aSOFTWARE_REQUIRES_GIT[$software_id]=1
-
#------------------
software_id=154
- aSOFTWARE_WHIP_NAME[$software_id]='Roon Server'
- aSOFTWARE_WHIP_DESC[$software_id]='Roon capable audio player and core'
+ aSOFTWARE_NAME[$software_id]='Roon Server'
+ aSOFTWARE_DESC[$software_id]='Roon capable audio player and core'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7966#p7966'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
-
- # - x86_64 only
+ # x86_64 only
for ((i=1; i<=$MAX_G_HW_ARCH; i++))
do
@@ -785,12 +718,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
done
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=1
-
#------------------
software_id=159
- aSOFTWARE_WHIP_NAME[$software_id]='Allo'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface'
+ aSOFTWARE_NAME[$software_id]='Allo'
+ aSOFTWARE_DESC[$software_id]='web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=-1
#aSOFTWARE_ONLINEDOC_URL[$software_id]
@@ -798,55 +730,50 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
-
#------------------
software_id=160
- aSOFTWARE_WHIP_NAME[$software_id]='Allo_update'
- aSOFTWARE_WHIP_DESC[$software_id]='quick reinstall/update web only'
+ aSOFTWARE_NAME[$software_id]='Allo_update'
+ aSOFTWARE_DESC[$software_id]='quick reinstall/update web only'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=-1
#aSOFTWARE_ONLINEDOC_URL[$software_id]
-
#------------------
software_id=163
- aSOFTWARE_WHIP_NAME[$software_id]='GMediaRender'
- aSOFTWARE_WHIP_DESC[$software_id]='DLNA audio render/endpoint'
+ aSOFTWARE_NAME[$software_id]='GMediaRender'
+ aSOFTWARE_DESC[$software_id]='DLNA audio render/endpoint'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9012#p9012'
-
#------------------
software_id=167
- aSOFTWARE_WHIP_NAME[$software_id]='Raspotify'
- aSOFTWARE_WHIP_DESC[$software_id]='spotify connect client'
+ aSOFTWARE_NAME[$software_id]='Raspotify'
+ aSOFTWARE_DESC[$software_id]='spotify connect client'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9368#p9368'
-
- # - ARMv8 - x86_64
+ # - ARMv8
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
+ # - x86_64
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,10]=0
-
#------------------
software_id=80
- aSOFTWARE_WHIP_NAME[$software_id]='Ubooquity'
- aSOFTWARE_WHIP_DESC[$software_id]='a free home server for your comics and ebooks library'
+ aSOFTWARE_NAME[$software_id]='Ubooquity'
+ aSOFTWARE_DESC[$software_id]='a free home server for your comics and ebooks library'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12969#p12969'
-
#------------------
software_id=86
- aSOFTWARE_WHIP_NAME[$software_id]='Roon Extension Manager'
- aSOFTWARE_WHIP_DESC[$software_id]='Manage extensions from within Roon'
+ aSOFTWARE_NAME[$software_id]='Roon Extension Manager'
+ aSOFTWARE_DESC[$software_id]='Manage extensions from within Roon'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_GIT[$software_id]=1
@@ -857,137 +784,124 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=44
- aSOFTWARE_WHIP_NAME[$software_id]='Transmission'
- aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c)'
+ aSOFTWARE_NAME[$software_id]='Transmission'
+ aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (c)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=46#p46'
-
#------------------
software_id=45
- aSOFTWARE_WHIP_NAME[$software_id]='Deluge'
- aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (python)'
+ aSOFTWARE_NAME[$software_id]='Deluge'
+ aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (python)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=61#p61'
-
#------------------
software_id=46
- aSOFTWARE_WHIP_NAME[$software_id]='qBitTorrent'
- aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with web interface (c++)'
+ aSOFTWARE_NAME[$software_id]='qBitTorrent'
+ aSOFTWARE_DESC[$software_id]='bittorrent server with web interface (c++)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2272#p2272'
-
#------------------
software_id=107
- aSOFTWARE_WHIP_NAME[$software_id]='rTorrent'
- aSOFTWARE_WHIP_DESC[$software_id]='bittorrent server with rutorrent web interface'
+ aSOFTWARE_NAME[$software_id]='rTorrent'
+ aSOFTWARE_DESC[$software_id]='bittorrent server with rutorrent web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2603#p2603'
-
#------------------
software_id=116
- aSOFTWARE_WHIP_NAME[$software_id]='Medusa'
- aSOFTWARE_WHIP_DESC[$software_id]='Automatic Video Library Manager for TV Shows'
+ aSOFTWARE_NAME[$software_id]='Medusa'
+ aSOFTWARE_DESC[$software_id]='Automatic Video Library Manager for TV Shows'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3327#p3327'
-
#------------------
software_id=132
- aSOFTWARE_WHIP_NAME[$software_id]='Aria2'
- aSOFTWARE_WHIP_DESC[$software_id]='download manager with web interface'
+ aSOFTWARE_NAME[$software_id]='Aria2'
+ aSOFTWARE_DESC[$software_id]='download manager with web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6177#p6177'
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_SQLITE[$software_id]=1
-
#------------------
software_id=139
- aSOFTWARE_WHIP_NAME[$software_id]='SABnzbd'
- aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager'
+ aSOFTWARE_NAME[$software_id]='SABnzbd'
+ aSOFTWARE_DESC[$software_id]='nzb download manager'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747'
# Pre-compiling required on ARM
(( $G_HW_ARCH < 10 )) && aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
-
#------------------
software_id=142
- aSOFTWARE_WHIP_NAME[$software_id]='CouchPotato'
- aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies'
+ aSOFTWARE_NAME[$software_id]='CouchPotato'
+ aSOFTWARE_DESC[$software_id]='automatically download movies'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6747#p6747'
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1
-
#------------------
software_id=144
- aSOFTWARE_WHIP_NAME[$software_id]='Sonarr'
- aSOFTWARE_WHIP_DESC[$software_id]='automatically download TV shows'
+ aSOFTWARE_NAME[$software_id]='Sonarr'
+ aSOFTWARE_DESC[$software_id]='automatically download TV shows'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7455#p7455'
aSOFTWARE_REQUIRES_SQLITE[$software_id]=1
-
#------------------
software_id=145
- aSOFTWARE_WHIP_NAME[$software_id]='Radarr'
- aSOFTWARE_WHIP_DESC[$software_id]='automatically download movies'
+ aSOFTWARE_NAME[$software_id]='Radarr'
+ aSOFTWARE_DESC[$software_id]='automatically download movies'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7457#p7457'
aSOFTWARE_REQUIRES_SQLITE[$software_id]=1
-
#------------------
software_id=106
- aSOFTWARE_WHIP_NAME[$software_id]='Lidarr'
- aSOFTWARE_WHIP_DESC[$software_id]='automatically download music'
+ aSOFTWARE_NAME[$software_id]='Lidarr'
+ aSOFTWARE_DESC[$software_id]='automatically download music'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13580#p13580'
aSOFTWARE_REQUIRES_SQLITE[$software_id]=1
-
#------------------
software_id=147
- aSOFTWARE_WHIP_NAME[$software_id]='Jackett'
- aSOFTWARE_WHIP_DESC[$software_id]='API support for your torrent trackers'
+ aSOFTWARE_NAME[$software_id]='Jackett'
+ aSOFTWARE_DESC[$software_id]='API support for your torrent trackers'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7503#p7503'
-
#------------------
software_id=149
- aSOFTWARE_WHIP_NAME[$software_id]='NZBget'
- aSOFTWARE_WHIP_DESC[$software_id]='nzb download manager'
+ aSOFTWARE_NAME[$software_id]='NZBget'
+ aSOFTWARE_DESC[$software_id]='nzb download manager'
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7575#p7575'
-
#------------------
software_id=155
- aSOFTWARE_WHIP_NAME[$software_id]='HTPC Manager'
- aSOFTWARE_WHIP_DESC[$software_id]='manage your HTPC from anywhere'
+ aSOFTWARE_NAME[$software_id]='HTPC Manager'
+ aSOFTWARE_DESC[$software_id]='manage your HTPC from anywhere'
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_TYPE[$software_id]=0
@@ -997,8 +911,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=47
- aSOFTWARE_WHIP_NAME[$software_id]='ownCloud'
- aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform'
+ aSOFTWARE_NAME[$software_id]='ownCloud'
+ aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
@@ -1007,119 +921,107 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=47#p47'
# ownCloud up to 10.2 does not support PHP7.3 (Buster): https://doc.owncloud.org/server/administration_manual/installation/system_requirements.html
aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
+ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
# ARMv6 devices have no chance to get some required PHP7.2 packages (APCu, Redis)
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
# Disable if PHP7.3 is already installed
command -v php7.3 &> /dev/null && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0
-
#------------------
software_id=114
- aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud'
- aSOFTWARE_WHIP_DESC[$software_id]='File sync, sharing and collaboration platform'
+ aSOFTWARE_NAME[$software_id]='Nextcloud'
+ aSOFTWARE_DESC[$software_id]='File sync, sharing and collaboration platform'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3026#p3026'
-
#------------------
software_id=168
- aSOFTWARE_WHIP_NAME[$software_id]='Nextcloud Talk'
- aSOFTWARE_WHIP_DESC[$software_id]='Video calls with configured coTURN server'
+ aSOFTWARE_NAME[$software_id]='Nextcloud Talk'
+ aSOFTWARE_DESC[$software_id]='Video calls with configured coTURN server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
# Currently requires manual domain and coTURN server port input.
# - To resolve: Default port 5349 could be used, but reliable method to get external domain/static IP is required.
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=15227#p15227'
-
#------------------
software_id=48
- aSOFTWARE_WHIP_NAME[$software_id]='Pydio'
- aSOFTWARE_WHIP_DESC[$software_id]='feature-rich backup and sync server'
+ aSOFTWARE_NAME[$software_id]='Pydio'
+ aSOFTWARE_DESC[$software_id]='feature-rich backup and sync server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1064#p1064'
-
#------------------
software_id=111
- aSOFTWARE_WHIP_NAME[$software_id]='UrBackup Server'
- aSOFTWARE_WHIP_DESC[$software_id]='full system backup server'
+ aSOFTWARE_NAME[$software_id]='UrBackup Server'
+ aSOFTWARE_DESC[$software_id]='full system backup server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=65#p65'
-
# - ARMv6
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
#------------------
software_id=49
- aSOFTWARE_WHIP_NAME[$software_id]='Gogs'
- aSOFTWARE_WHIP_DESC[$software_id]='personal github server with web interface'
+ aSOFTWARE_NAME[$software_id]='Gogs'
+ aSOFTWARE_DESC[$software_id]='personal github server with web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2187#p2187'
-
# - ARMv8
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
#------------------
software_id=50
- aSOFTWARE_WHIP_NAME[$software_id]='Syncthing'
- aSOFTWARE_WHIP_DESC[$software_id]='backup and sync server with web interface'
+ aSOFTWARE_NAME[$software_id]='Syncthing'
+ aSOFTWARE_DESC[$software_id]='backup and sync server with web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2363#p2363'
-
#------------------
software_id=134
- aSOFTWARE_WHIP_NAME[$software_id]='Tonido'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight cloud based backup system'
+ aSOFTWARE_NAME[$software_id]='Tonido'
+ aSOFTWARE_DESC[$software_id]='lightweight cloud based backup system'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6476#p6476'
-
- # - ARMv6 - ARMv8
+ # - ARMv6
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
+ # - ARMv8
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
#------------------
software_id=158
- aSOFTWARE_WHIP_NAME[$software_id]='Minio'
- aSOFTWARE_WHIP_DESC[$software_id]='S3 compatible distributed object server'
+ aSOFTWARE_NAME[$software_id]='Minio'
+ aSOFTWARE_DESC[$software_id]='S3 compatible distributed object server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
-
#------------------
- software_id=161
- aSOFTWARE_WHIP_NAME[$software_id]='FuguHub'
- aSOFTWARE_WHIP_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=4
+ software_id=161
+ aSOFTWARE_NAME[$software_id]='FuguHub'
+ aSOFTWARE_DESC[$software_id]='Lightweight WebDAV cloud (eg: dropbox) with a CMS'
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
+ # - ARMv8
+ aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
+ #------------------
+ software_id=165
- # - ARMv8
- aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
- #------------------
- software_id=165
-
- aSOFTWARE_WHIP_NAME[$software_id]='Gitea'
- aSOFTWARE_WHIP_DESC[$software_id]='Git with a cup of tea'
+ aSOFTWARE_NAME[$software_id]='Gitea'
+ aSOFTWARE_DESC[$software_id]='Git with a cup of tea'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_GIT[$software_id]=1
@@ -1130,84 +1032,74 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=108
- aSOFTWARE_WHIP_NAME[$software_id]='AmiBerry'
- aSOFTWARE_WHIP_DESC[$software_id]='amiga emulator'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=5
+ aSOFTWARE_NAME[$software_id]='Amiberry'
+ aSOFTWARE_DESC[$software_id]='Optimised Amiga emulator for ARM-based SoCs'
aSOFTWARE_TYPE[$software_id]=0
- aSOFTWARE_REQUIRES_ALSA[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=64#p64'
- aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
-
- # - RPi only
+ (( $G_DISTRO < 5 )) && aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
+ aSOFTWARE_REQUIRES_ALSA[$software_id]=1
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
- aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1 # + ASUS TB
-
- # + XU4 test
- #aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,11]=1 # Requires Stretch due to libc requirements
-
+ # + Odroid XU4
+ aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,11]=1
+ # + ASUS TB
+ aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,52]=1
#------------------
software_id=51
- aSOFTWARE_WHIP_NAME[$software_id]='OpenTyrian'
- aSOFTWARE_WHIP_DESC[$software_id]='a classic retro game, addictive'
+ aSOFTWARE_NAME[$software_id]='OpenTyrian'
+ aSOFTWARE_DESC[$software_id]='a classic retro game, addictive'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=45#p45'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
# + x86_64
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1
-
-
#------------------
software_id=112
- aSOFTWARE_WHIP_NAME[$software_id]='DXX-Rebirth'
- aSOFTWARE_WHIP_DESC[$software_id]='Descent 1/2'
+ aSOFTWARE_NAME[$software_id]='DXX-Rebirth'
+ aSOFTWARE_DESC[$software_id]='Descent 1/2'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2963#p2963'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=52
- aSOFTWARE_WHIP_NAME[$software_id]='Cuberite'
- aSOFTWARE_WHIP_DESC[$software_id]='minecraft server with web interface (c++)'
+ aSOFTWARE_NAME[$software_id]='Cuberite'
+ aSOFTWARE_DESC[$software_id]='minecraft server with web interface (c++)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2068#p2068'
-
# - ARMv8
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
#------------------
software_id=53
- aSOFTWARE_WHIP_NAME[$software_id]='MineOS'
- aSOFTWARE_WHIP_DESC[$software_id]='minecraft servers with web interface (java)'
+ aSOFTWARE_NAME[$software_id]='MineOS'
+ aSOFTWARE_DESC[$software_id]='minecraft servers with web interface (java)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
@@ -1215,19 +1107,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_REQUIRES_NODEJS[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2069#p2069'
-
#------------------
software_id=156
- aSOFTWARE_WHIP_NAME[$software_id]='Steam'
- aSOFTWARE_WHIP_DESC[$software_id]='client'
+ aSOFTWARE_NAME[$software_id]='Steam'
+ aSOFTWARE_DESC[$software_id]='client'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=8016#p8016'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
-
# Native PC only
for ((i=0; i<=$MAX_G_HW_MODEL; i++))
do
@@ -1236,12 +1126,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
done
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,21]=1
-
#------------------
software_id=164
- aSOFTWARE_WHIP_NAME[$software_id]='Nukkit'
- aSOFTWARE_WHIP_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition'
+ aSOFTWARE_NAME[$software_id]='Nukkit'
+ aSOFTWARE_DESC[$software_id]='A nuclear-powered server for Minecraft Pocket Edition'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
@@ -1251,101 +1140,93 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=54
- aSOFTWARE_WHIP_NAME[$software_id]='phpBB'
- aSOFTWARE_WHIP_DESC[$software_id]='bulletin board forum software'
+ aSOFTWARE_NAME[$software_id]='phpBB'
+ aSOFTWARE_DESC[$software_id]='bulletin board forum software'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=51#p51'
-
# phpBB up to 3.2 does not support PHP7.3 (Buster)
aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
+ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
# ARMv6 devices have no chance to get some required PHP7.2 packages (APCu, Redis)
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
# Disable if PHP7.3 is already installed
command -v php7.3 &> /dev/null && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0
-
#------------------
software_id=55
- aSOFTWARE_WHIP_NAME[$software_id]='Wordpress'
- aSOFTWARE_WHIP_DESC[$software_id]='website blog and publishing platform'
+ aSOFTWARE_NAME[$software_id]='Wordpress'
+ aSOFTWARE_DESC[$software_id]='website blog and publishing platform'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=395#p395'
-
#------------------
software_id=38
- aSOFTWARE_WHIP_NAME[$software_id]='FreshRSS'
- aSOFTWARE_WHIP_DESC[$software_id]='self-hosted RSS feed aggregator'
+ aSOFTWARE_NAME[$software_id]='FreshRSS'
+ aSOFTWARE_DESC[$software_id]='self-hosted RSS feed aggregator'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13918#p13918'
-
#------------------
software_id=56
- aSOFTWARE_WHIP_NAME[$software_id]='Image Gallery'
- aSOFTWARE_WHIP_DESC[$software_id]='website to host / browse your images'
+ aSOFTWARE_NAME[$software_id]='Image Gallery'
+ aSOFTWARE_DESC[$software_id]='website to host / browse your images'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=480#p480'
-
#------------------
software_id=57
- aSOFTWARE_WHIP_NAME[$software_id]='BaiKal'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight caldav + carddav server'
+ aSOFTWARE_NAME[$software_id]='BaiKal'
+ aSOFTWARE_DESC[$software_id]='lightweight caldav + carddav server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1502#p1502'
-
#------------------
software_id=58
- aSOFTWARE_WHIP_NAME[$software_id]='OpenBazaar'
- aSOFTWARE_WHIP_DESC[$software_id]='decentralised peer to peer bitcoin market'
+ aSOFTWARE_NAME[$software_id]='OpenBazaar'
+ aSOFTWARE_DESC[$software_id]='decentralised peer to peer bitcoin market'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1796#p1796'
-
#------------------
software_id=133
- aSOFTWARE_WHIP_NAME[$software_id]='YaCy'
- aSOFTWARE_WHIP_DESC[$software_id]='decentralised open source search engine'
+ aSOFTWARE_NAME[$software_id]='YaCy'
+ aSOFTWARE_DESC[$software_id]='decentralised open source search engine'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6202#p6202'
-
#------------------
software_id=2
- aSOFTWARE_WHIP_NAME[$software_id]='Folding@Home'
- aSOFTWARE_WHIP_DESC[$software_id]='distributed disease research project'
+ aSOFTWARE_NAME[$software_id]='Folding@Home'
+ aSOFTWARE_DESC[$software_id]='distributed disease research project'
aSOFTWARE_CATEGORY_INDEX[$software_id]=20
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=13704#p13704'
-
- # - x86_64 only
+ # x86_64 only
for ((i=1; i<$MAX_G_HW_ARCH; i++))
do
@@ -1353,366 +1234,314 @@ DietPi-Software will decrypt and use it for software installs. You can change it
done
- # - Jessie: https://github.com/MichaIng/DietPi/pull/1992#issuecomment-410772255
- aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0
-
- #------------------
-
# Camera
#--------------------------------------------------------------------------------
software_id=59
- aSOFTWARE_WHIP_NAME[$software_id]='RPi Cam Control'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface & controls for your rpi camera'
+ aSOFTWARE_NAME[$software_id]='RPi Cam Control'
+ aSOFTWARE_DESC[$software_id]='web interface & controls for your rpi camera'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=48#p48'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=136
- aSOFTWARE_WHIP_NAME[$software_id]='MotionEye'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface & surveillance for your camera'
+ aSOFTWARE_NAME[$software_id]='MotionEye'
+ aSOFTWARE_DESC[$software_id]='web interface & surveillance for your camera'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6610#p6610'
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
- # - Jessie
- aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0
-
- #------------------
-
# WiFi Hotspot
#--------------------------------------------------------------------------------
software_id=60
- aSOFTWARE_WHIP_NAME[$software_id]='WiFi Hotspot'
- aSOFTWARE_WHIP_DESC[$software_id]='turn your device into a wifi hotspot'
+ aSOFTWARE_NAME[$software_id]='WiFi Hotspot'
+ aSOFTWARE_DESC[$software_id]='turn your device into a wifi hotspot'
aSOFTWARE_CATEGORY_INDEX[$software_id]=8
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1207#p1207'
-
- # - VM
- aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0
-
#------------------
software_id=61
- aSOFTWARE_WHIP_NAME[$software_id]='Tor Hotspot'
- aSOFTWARE_WHIP_DESC[$software_id]='optional: route hotspot traffic through tor'
+ aSOFTWARE_NAME[$software_id]='Tor Hotspot'
+ aSOFTWARE_DESC[$software_id]='optional: route hotspot traffic through tor'
aSOFTWARE_CATEGORY_INDEX[$software_id]=8
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1529#p1529'
- # - VM
- aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,20]=0
-
- #------------------
-
# System stats
#--------------------------------------------------------------------------------
software_id=62
- aSOFTWARE_WHIP_NAME[$software_id]='DietPi-Cloudshell'
- aSOFTWARE_WHIP_DESC[$software_id]='system stats displayed on lcd/panel'
+ aSOFTWARE_NAME[$software_id]='DietPi-Cloudshell'
+ aSOFTWARE_DESC[$software_id]='system stats displayed on lcd/panel'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=204#p204'
-
#------------------
software_id=63
- aSOFTWARE_WHIP_NAME[$software_id]='LinuxDash'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats'
+ aSOFTWARE_NAME[$software_id]='LinuxDash'
+ aSOFTWARE_DESC[$software_id]='web interface system stats'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=108#p108'
-
#------------------
software_id=64
- aSOFTWARE_WHIP_NAME[$software_id]='PhpSysInfo'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats'
+ aSOFTWARE_NAME[$software_id]='PhpSysInfo'
+ aSOFTWARE_DESC[$software_id]='web interface system stats'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=451#p451'
-
#------------------
software_id=65
- aSOFTWARE_WHIP_NAME[$software_id]='NetData'
- aSOFTWARE_WHIP_DESC[$software_id]='real-time performance monitoring'
+ aSOFTWARE_NAME[$software_id]='Netdata'
+ aSOFTWARE_DESC[$software_id]='real-time performance monitoring'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
- # Node.js only required for our custom package
- (( $G_DISTRO < 4 || ( $G_HW_MODEL < 10 && $G_DISTRO < 5 ) )) && aSOFTWARE_REQUIRES_NODEJS[$software_id]=1
+ # Node.js only required for our custom v1.11 package for Stretch ARMv6 RPi
+ (( $G_HW_ARCH == 1 && $G_DISTRO < 5 )) && aSOFTWARE_REQUIRES_NODEJS[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1611#p1611'
-
#------------------
software_id=66
- aSOFTWARE_WHIP_NAME[$software_id]='RPi-Monitor'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface system stats'
+ aSOFTWARE_NAME[$software_id]='RPi-Monitor'
+ aSOFTWARE_DESC[$software_id]='web interface system stats'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1503#p1503'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=115
- aSOFTWARE_WHIP_NAME[$software_id]='Webmin'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface system management'
+ aSOFTWARE_NAME[$software_id]='Webmin'
+ aSOFTWARE_DESC[$software_id]='web interface system management'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3047#p3047'
- aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1
-
#------------------
software_id=162
- aSOFTWARE_WHIP_NAME[$software_id]='Docker'
- aSOFTWARE_WHIP_DESC[$software_id]='Build, ship, and run distributed applications'
+ aSOFTWARE_NAME[$software_id]='Docker'
+ aSOFTWARE_DESC[$software_id]='Build, ship, and run distributed applications'
aSOFTWARE_CATEGORY_INDEX[$software_id]=9
aSOFTWARE_TYPE[$software_id]=0
-
+ # - Bullseye
+ aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
# Remote Access
#--------------------------------------------------------------------------------
software_id=67
- aSOFTWARE_WHIP_NAME[$software_id]='NoIp'
- aSOFTWARE_WHIP_DESC[$software_id]='url website address for your device'
+ aSOFTWARE_NAME[$software_id]='NoIp'
+ aSOFTWARE_DESC[$software_id]='url website address for your device'
aSOFTWARE_CATEGORY_INDEX[$software_id]=10
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=58#p58'
-
#------------------
software_id=68
- aSOFTWARE_WHIP_NAME[$software_id]='Remot3.it'
- aSOFTWARE_WHIP_DESC[$software_id]='(Weaved) access your device over the internet'
+ aSOFTWARE_NAME[$software_id]='Remot3.it'
+ aSOFTWARE_DESC[$software_id]='(Weaved) access your device over the internet'
aSOFTWARE_CATEGORY_INDEX[$software_id]=10
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=188#p188'
-
#------------------
software_id=138
- aSOFTWARE_WHIP_NAME[$software_id]='VirtualHere'
- aSOFTWARE_WHIP_DESC[$software_id]='server: share USB devices over the network'
+ aSOFTWARE_NAME[$software_id]='VirtualHere'
+ aSOFTWARE_DESC[$software_id]='server: share USB devices over the network'
aSOFTWARE_CATEGORY_INDEX[$software_id]=10
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6709#p6709'
- #------------------
-
- #Hardware projects
+ # Hardware projects
#--------------------------------------------------------------------------------
software_id=69
- aSOFTWARE_WHIP_NAME[$software_id]='RPi.GPIO'
- aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library for rpi (python)'
+ aSOFTWARE_NAME[$software_id]='RPi.GPIO'
+ aSOFTWARE_DESC[$software_id]='gpio interface library for rpi (python)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1065#p1065'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=70
- aSOFTWARE_WHIP_NAME[$software_id]='WiringPi'
- aSOFTWARE_WHIP_DESC[$software_id]='gpio interface library (c)'
+ aSOFTWARE_NAME[$software_id]='WiringPi'
+ aSOFTWARE_DESC[$software_id]='gpio interface library (c)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1066#p1066'
-
- # - RPi + Odroids only
+ # RPi + Odroids only
for ((i=20; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
# + BPi Pro
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,51]=1
-
#------------------
software_id=71
- aSOFTWARE_WHIP_NAME[$software_id]='WebIOPi'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface to control rpi.gpio'
+ aSOFTWARE_NAME[$software_id]='WebIOPi'
+ aSOFTWARE_DESC[$software_id]='web interface to control rpi.gpio'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=189#p189'
-
- # - RPi1/2/Zero only
+ # RPi1/2/Zero only
for ((i=3; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=72
- aSOFTWARE_WHIP_NAME[$software_id]='I2C'
- aSOFTWARE_WHIP_DESC[$software_id]='enables support for i2c based hardware'
+ aSOFTWARE_NAME[$software_id]='I2C'
+ aSOFTWARE_DESC[$software_id]='enables support for i2c based hardware'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=100
- aSOFTWARE_WHIP_NAME[$software_id]='PiJuice'
- aSOFTWARE_WHIP_DESC[$software_id]='pisupply ups'
+ aSOFTWARE_NAME[$software_id]='PiJuice'
+ aSOFTWARE_DESC[$software_id]='pisupply ups'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=10740#p10740'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=122
- aSOFTWARE_WHIP_NAME[$software_id]='Node-Red'
- aSOFTWARE_WHIP_DESC[$software_id]='tool for wiring devices, APIs and online services'
+ aSOFTWARE_NAME[$software_id]='Node-Red'
+ aSOFTWARE_DESC[$software_id]='tool for wiring devices, APIs and online services'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4292#p4292'
aSOFTWARE_REQUIRES_NODEJS[$software_id]=1
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
-
#------------------
software_id=123
- aSOFTWARE_WHIP_NAME[$software_id]='Mosquitto '
- aSOFTWARE_WHIP_DESC[$software_id]='MQTT messaging broker'
+ aSOFTWARE_NAME[$software_id]='Mosquitto '
+ aSOFTWARE_DESC[$software_id]='MQTT messaging broker'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4293#p4293'
-
#------------------
software_id=131
- aSOFTWARE_WHIP_NAME[$software_id]='Blynk Server'
- aSOFTWARE_WHIP_DESC[$software_id]='msg controller for blynk mobile app and sbcs'
+ aSOFTWARE_NAME[$software_id]='Blynk Server'
+ aSOFTWARE_DESC[$software_id]='msg controller for blynk mobile app and sbcs'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=5901#p5901'
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
aSOFTWARE_REQUIRES_NODEJS[$software_id]=1
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
-
#------------------
software_id=166
- aSOFTWARE_WHIP_NAME[$software_id]='PI-SPC'
- aSOFTWARE_WHIP_DESC[$software_id]='audiophonics pi-spc power control module'
+ aSOFTWARE_NAME[$software_id]='PI-SPC'
+ aSOFTWARE_DESC[$software_id]='audiophonics pi-spc power control module'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9359#p9359'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=169
- aSOFTWARE_WHIP_NAME[$software_id]='Google AIY'
- aSOFTWARE_WHIP_DESC[$software_id]='voice kit'
+ aSOFTWARE_NAME[$software_id]='Google AIY'
+ aSOFTWARE_DESC[$software_id]='voice kit'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=9486#p9486'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=176
- aSOFTWARE_WHIP_NAME[$software_id]='Mycroft AI'
- aSOFTWARE_WHIP_DESC[$software_id]='Open Source Voice Assistant'
+ aSOFTWARE_NAME[$software_id]='Mycroft AI'
+ aSOFTWARE_DESC[$software_id]='Open Source Voice Assistant'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=18562#p18562'
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
-
#------------------
software_id=74
- aSOFTWARE_WHIP_NAME[$software_id]='InfluxDB'
- aSOFTWARE_WHIP_DESC[$software_id]='time-series database'
+ aSOFTWARE_NAME[$software_id]='InfluxDB'
+ aSOFTWARE_DESC[$software_id]='time-series database'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12523#p12523'
-
#------------------
software_id=77
- aSOFTWARE_WHIP_NAME[$software_id]='Grafana'
- aSOFTWARE_WHIP_DESC[$software_id]='platform for analytics and monitoring'
+ aSOFTWARE_NAME[$software_id]='Grafana'
+ aSOFTWARE_DESC[$software_id]='platform for analytics and monitoring'
aSOFTWARE_CATEGORY_INDEX[$software_id]=11
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=12524#p12524'
@@ -1721,180 +1550,161 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=73
- aSOFTWARE_WHIP_NAME[$software_id]='Fail2Ban'
- aSOFTWARE_WHIP_DESC[$software_id]='prevents brute-force attacks with ip ban'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=12
+ aSOFTWARE_NAME[$software_id]='Fail2Ban'
+ aSOFTWARE_DESC[$software_id]='prevents brute-force attacks with ip ban'
aSOFTWARE_TYPE[$software_id]=0
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=12
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=452#p452'
- #------------------
# Webserver stacks
#--------------------------------------------------------------------------------
software_id=75
- aSOFTWARE_WHIP_NAME[$software_id]='LASP'
- aSOFTWARE_WHIP_DESC[$software_id]='apache2 | sqlite | php'
+ aSOFTWARE_NAME[$software_id]='LASP'
+ aSOFTWARE_DESC[$software_id]='apache2 | sqlite | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52'
-
#------------------
software_id=76
- aSOFTWARE_WHIP_NAME[$software_id]='LAMP'
- aSOFTWARE_WHIP_DESC[$software_id]='apache2 | mariadb | php'
+ aSOFTWARE_NAME[$software_id]='LAMP'
+ aSOFTWARE_DESC[$software_id]='apache2 | mariadb | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52'
-
#------------------
software_id=78
- aSOFTWARE_WHIP_NAME[$software_id]='LESP'
- aSOFTWARE_WHIP_DESC[$software_id]='nginx | sqlite | php'
+ aSOFTWARE_NAME[$software_id]='LESP'
+ aSOFTWARE_DESC[$software_id]='nginx | sqlite | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53'
-
#------------------
software_id=79
- aSOFTWARE_WHIP_NAME[$software_id]='LEMP'
- aSOFTWARE_WHIP_DESC[$software_id]='nginx | mariadb | php'
+ aSOFTWARE_NAME[$software_id]='LEMP'
+ aSOFTWARE_DESC[$software_id]='nginx | mariadb | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53'
-
#------------------
software_id=81
- aSOFTWARE_WHIP_NAME[$software_id]='LLSP'
- aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | sqlite | php'
+ aSOFTWARE_NAME[$software_id]='LLSP'
+ aSOFTWARE_DESC[$software_id]='lighttpd | sqlite | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=82
- aSOFTWARE_WHIP_NAME[$software_id]='LLMP'
- aSOFTWARE_WHIP_DESC[$software_id]='lighttpd | mariadb | php'
+ aSOFTWARE_NAME[$software_id]='LLMP'
+ aSOFTWARE_DESC[$software_id]='lighttpd | mariadb | php'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=83
- aSOFTWARE_WHIP_NAME[$software_id]='Apache2'
- aSOFTWARE_WHIP_DESC[$software_id]='webserver'
+ aSOFTWARE_NAME[$software_id]='Apache2'
+ aSOFTWARE_DESC[$software_id]='webserver'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=52#p52'
-
#------------------
software_id=84
- aSOFTWARE_WHIP_NAME[$software_id]='Lighttpd'
- aSOFTWARE_WHIP_DESC[$software_id]='webserver'
+ aSOFTWARE_NAME[$software_id]='Lighttpd'
+ aSOFTWARE_DESC[$software_id]='webserver'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=85
- aSOFTWARE_WHIP_NAME[$software_id]='Nginx'
- aSOFTWARE_WHIP_DESC[$software_id]='webserver'
+ aSOFTWARE_NAME[$software_id]='Nginx'
+ aSOFTWARE_DESC[$software_id]='webserver'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=53#p53'
-
#------------------
software_id=87
- aSOFTWARE_WHIP_NAME[$software_id]='SQLite'
- aSOFTWARE_WHIP_DESC[$software_id]='database'
+ aSOFTWARE_NAME[$software_id]='SQLite'
+ aSOFTWARE_DESC[$software_id]='database'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=88
- aSOFTWARE_WHIP_NAME[$software_id]='MariaDB'
- aSOFTWARE_WHIP_DESC[$software_id]='database'
+ aSOFTWARE_NAME[$software_id]='MariaDB'
+ aSOFTWARE_DESC[$software_id]='database'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=89
- aSOFTWARE_WHIP_NAME[$software_id]='PHP'
- aSOFTWARE_WHIP_DESC[$software_id]='Hypertext Preprocessor for dynamic web content'
+ aSOFTWARE_NAME[$software_id]='PHP'
+ aSOFTWARE_DESC[$software_id]='Hypertext Preprocessor for dynamic web content'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1335#p1335'
-
#------------------
software_id=90
- aSOFTWARE_WHIP_NAME[$software_id]='phpMyAdmin'
- aSOFTWARE_WHIP_DESC[$software_id]='optional mysql admin tools'
+ aSOFTWARE_NAME[$software_id]='phpMyAdmin'
+ aSOFTWARE_DESC[$software_id]='optional mysql admin tools'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
aSOFTWARE_REQUIRES_MYSQL[$software_id]=1
aSOFTWARE_REQUIRES_PHP[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=54#p54'
-
# - non-RPi Buster: https://packages.debian.org/phpmyadmin
- (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
-
+ (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 && aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
# Since the APT package depends on PHP meta packages, PHP7.2 cannot be installed
# Since ownCloud + phpBB require PHP7.2 currently, phpMyAdmin is not compatible with those
[[ -f '/var/www/owncloud/occ' || -f '/var/www/phpBB3/config.php' ]] && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0
-
#------------------
software_id=91
- aSOFTWARE_WHIP_NAME[$software_id]='Redis'
- aSOFTWARE_WHIP_DESC[$software_id]='optional non-sql database store'
+ aSOFTWARE_NAME[$software_id]='Redis'
+ aSOFTWARE_DESC[$software_id]='optional non-sql database store'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
-
#------------------
software_id=92
- aSOFTWARE_WHIP_NAME[$software_id]='CertBot'
- aSOFTWARE_WHIP_DESC[$software_id]='free, ssl cert install allowing https://'
+ aSOFTWARE_NAME[$software_id]='CertBot'
+ aSOFTWARE_DESC[$software_id]='free, ssl cert install allowing https://'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1061#p1062'
-
#------------------
software_id=125
- aSOFTWARE_WHIP_NAME[$software_id]='Tomcat8'
- aSOFTWARE_WHIP_DESC[$software_id]='apache tomcat server'
+ aSOFTWARE_NAME[$software_id]='Tomcat8'
+ aSOFTWARE_DESC[$software_id]='apache tomcat server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=13
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=4316#p4316'
aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$software_id]=1
-
# - non-RPi Buster: https://packages.debian.org/tomcat8
- (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0
+ (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 && aSOFTWARE_AVAIL_G_DISTRO[$software_id,6]=0
# Pi-hole
#--------------------------------------------------------------------------------
software_id=93
- aSOFTWARE_WHIP_NAME[$software_id]='Pi-hole'
- aSOFTWARE_WHIP_DESC[$software_id]='block adverts for any device on your network'
+ aSOFTWARE_NAME[$software_id]='Pi-hole'
+ aSOFTWARE_DESC[$software_id]='block adverts for any device on your network'
aSOFTWARE_CATEGORY_INDEX[$software_id]=14
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_GIT[$software_id]=1
@@ -1908,84 +1718,75 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=94
- aSOFTWARE_WHIP_NAME[$software_id]='ProFTP'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight ftp server'
+ aSOFTWARE_NAME[$software_id]='ProFTP'
+ aSOFTWARE_DESC[$software_id]='lightweight ftp server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=15
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=55#p55'
-
#------------------
software_id=95
- aSOFTWARE_WHIP_NAME[$software_id]='vsFTPD'
- aSOFTWARE_WHIP_DESC[$software_id]='alternative ftp server'
+ aSOFTWARE_NAME[$software_id]='vsFTPD'
+ aSOFTWARE_DESC[$software_id]='alternative ftp server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=15
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2820#p2820'
-
#------------------
software_id=96
- aSOFTWARE_WHIP_NAME[$software_id]='Samba'
- aSOFTWARE_WHIP_DESC[$software_id]='feature-rich file server'
+ aSOFTWARE_NAME[$software_id]='Samba'
+ aSOFTWARE_DESC[$software_id]='feature-rich file server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=15
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=56#p56'
-
#------------------
software_id=109
- aSOFTWARE_WHIP_NAME[$software_id]='NFS'
- aSOFTWARE_WHIP_DESC[$software_id]='network file system server'
+ aSOFTWARE_NAME[$software_id]='NFS'
+ aSOFTWARE_DESC[$software_id]='network file system server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=15
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=2821#p2821'
-
#------------------
# VPN
#--------------------------------------------------------------------------------
software_id=97
- aSOFTWARE_WHIP_NAME[$software_id]='OpenVPN'
- aSOFTWARE_WHIP_DESC[$software_id]='vpn server'
+ aSOFTWARE_NAME[$software_id]='OpenVPN'
+ aSOFTWARE_DESC[$software_id]='vpn server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=16
aSOFTWARE_TYPE[$software_id]=0
- aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=613#p613'
-
#------------------
software_id=117
- aSOFTWARE_WHIP_NAME[$software_id]='PiVPN'
- aSOFTWARE_WHIP_DESC[$software_id]='openvpn server install & management tool'
+ aSOFTWARE_NAME[$software_id]='PiVPN'
+ aSOFTWARE_DESC[$software_id]='openvpn server install & management tool'
aSOFTWARE_CATEGORY_INDEX[$software_id]=16
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=3469#p3469'
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
-
#------------------
software_id=171
- aSOFTWARE_WHIP_NAME[$software_id]='DietPi-NordVPN'
- aSOFTWARE_WHIP_DESC[$software_id]='vpn client with connection gui'
+ aSOFTWARE_NAME[$software_id]='DietPi-NordVPN'
+ aSOFTWARE_DESC[$software_id]='vpn client with connection gui'
aSOFTWARE_CATEGORY_INDEX[$software_id]=16
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p15975#p15975'
-
#------------------
software_id=172
- aSOFTWARE_WHIP_NAME[$software_id]='WireGuard'
- aSOFTWARE_WHIP_DESC[$software_id]='an extremely simple yet fast and modern VPN'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=16
+ aSOFTWARE_NAME[$software_id]='WireGuard'
+ aSOFTWARE_DESC[$software_id]='an extremely simple yet fast and modern VPN'
aSOFTWARE_TYPE[$software_id]=0
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=16
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=16308#p16308'
# Required to ask for public domain/IP and desired VPN server port
aSOFTWARE_REQUIRES_USERINPUT[$software_id]=1
-
# Disable all
for ((i=0; i<=$MAX_G_HW_MODEL; i++))
do
@@ -1993,23 +1794,15 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
- # - ARMv6
- aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0
-
- # + RPi/Odroids/x86_64 | ARMv6 disabled
- if (( $G_HW_MODEL < 13 || $G_HW_MODEL == 14 || $G_HW_ARCH == 10 )); then
-
- aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=1
-
- fi
+ # + RPi/Odroids/x86_64
+ (( $G_HW_MODEL < 13 || $G_HW_MODEL == 14 || $G_HW_ARCH == 10 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=1
# Advanced Networking
#--------------------------------------------------------------------------------
software_id=98
- aSOFTWARE_WHIP_NAME[$software_id]='HaProxy'
- aSOFTWARE_WHIP_DESC[$software_id]='high performance tcp/http load balancer'
+ aSOFTWARE_NAME[$software_id]='HAProxy'
+ aSOFTWARE_DESC[$software_id]='high performance tcp/http load balancer'
aSOFTWARE_CATEGORY_INDEX[$software_id]=17
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_BUILDESSENTIAL[$software_id]=1
@@ -2019,25 +1812,23 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=99
- aSOFTWARE_WHIP_NAME[$software_id]='EmonPi'
- aSOFTWARE_WHIP_DESC[$software_id]='energy usage addon board with web interface'
+ aSOFTWARE_NAME[$software_id]='EmonPi'
+ aSOFTWARE_DESC[$software_id]='energy usage addon board with web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=18
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=1525#p1525'
-
- # - RPi only
+ # RPi only
for ((i=10; i<=$MAX_G_HW_MODEL; i++))
do
aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$i]=0
done
-
#------------------
software_id=157
- aSOFTWARE_WHIP_NAME[$software_id]='Home Assistant'
- aSOFTWARE_WHIP_DESC[$software_id]='open-source home automation platform'
+ aSOFTWARE_NAME[$software_id]='Home Assistant'
+ aSOFTWARE_DESC[$software_id]='open-source home automation platform'
aSOFTWARE_CATEGORY_INDEX[$software_id]=18
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_REQUIRES_GIT[$software_id]=1
@@ -2046,27 +1837,21 @@ DietPi-Software will decrypt and use it for software installs. You can change it
aSOFTWARE_REQUIRES_FFMPEG[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=70#p70'
- #------------------
-
# Printing
#--------------------------------------------------------------------------------
software_id=137
- aSOFTWARE_WHIP_NAME[$software_id]='CloudPrint'
- aSOFTWARE_WHIP_DESC[$software_id]='print server for google cloud print'
+ aSOFTWARE_NAME[$software_id]='CloudPrint'
+ aSOFTWARE_DESC[$software_id]='print server for google cloud print'
aSOFTWARE_CATEGORY_INDEX[$software_id]=19
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=6630#p6630'
aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1 # Not required, but comes in as package dep
-
- # - ARMv8 on Jessie: https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002
- (( $G_DISTRO == 3 )) && aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
-
#------------------
software_id=153
- aSOFTWARE_WHIP_NAME[$software_id]='OctoPrint'
- aSOFTWARE_WHIP_DESC[$software_id]='web interface for controlling 3d printers'
+ aSOFTWARE_NAME[$software_id]='OctoPrint'
+ aSOFTWARE_DESC[$software_id]='web interface for controlling 3d printers'
aSOFTWARE_CATEGORY_INDEX[$software_id]=19
aSOFTWARE_TYPE[$software_id]=0
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=7958#p7958'
@@ -2081,44 +1866,42 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=0
- aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Client'
- aSOFTWARE_WHIP_DESC[$software_id]=''
+ aSOFTWARE_NAME[$software_id]='OpenSSH Client'
+ aSOFTWARE_DESC[$software_id]=''
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=1
- #------------------
# File server clients
#--------------------------------------------------------------------------------
software_id=1
- aSOFTWARE_WHIP_NAME[$software_id]='Samba Client'
- aSOFTWARE_WHIP_DESC[$software_id]='access network shares'
+ aSOFTWARE_NAME[$software_id]='Samba Client'
+ aSOFTWARE_DESC[$software_id]='access network shares'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc'
#------------------
software_id=110
- aSOFTWARE_WHIP_NAME[$software_id]='NFS Client'
- aSOFTWARE_WHIP_DESC[$software_id]='network file system client'
+ aSOFTWARE_NAME[$software_id]='NFS Client'
+ aSOFTWARE_DESC[$software_id]='network file system client'
aSOFTWARE_CATEGORY_INDEX[$software_id]=1
aSOFTWARE_TYPE[$software_id]=1
aSOFTWARE_ONLINEDOC_URL[$software_id]=' dietpi-config > Network Options: NAS/Misc'
- #------------------
# File managers
#--------------------------------------------------------------------------------
software_id=3
- aSOFTWARE_WHIP_NAME[$software_id]='MC'
- aSOFTWARE_WHIP_DESC[$software_id]='midnight commander, powerful file manager'
+ aSOFTWARE_NAME[$software_id]='MC'
+ aSOFTWARE_DESC[$software_id]='midnight commander, powerful file manager'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=4
- aSOFTWARE_WHIP_NAME[$software_id]='ViFM'
- aSOFTWARE_WHIP_DESC[$software_id]='file manager with vi bindings'
+ aSOFTWARE_NAME[$software_id]='ViFM'
+ aSOFTWARE_DESC[$software_id]='file manager with vi bindings'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=1
#------------------
@@ -2127,28 +1910,26 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=5
- aSOFTWARE_WHIP_NAME[$software_id]='ALSA'
- aSOFTWARE_WHIP_DESC[$software_id]='linux sound system'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=3
+ aSOFTWARE_NAME[$software_id]='ALSA'
+ aSOFTWARE_DESC[$software_id]='linux sound system'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=3
#------------------
software_id=6
- aSOFTWARE_WHIP_NAME[$software_id]='Xserver'
- aSOFTWARE_WHIP_DESC[$software_id]='linux display system'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=3
+ aSOFTWARE_NAME[$software_id]='Xserver'
+ aSOFTWARE_DESC[$software_id]='linux display system'
aSOFTWARE_TYPE[$software_id]=1
-
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=3
#------------------
software_id=151
- aSOFTWARE_WHIP_NAME[$software_id]='Nvidia'
- aSOFTWARE_WHIP_DESC[$software_id]='display driver'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=3
+ aSOFTWARE_NAME[$software_id]='Nvidia'
+ aSOFTWARE_DESC[$software_id]='display driver'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=3
aSOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
-
- # - Native PC only
+ # Native PC only
for ((i=0; i<=$MAX_G_HW_MODEL; i++))
do
@@ -2161,54 +1942,43 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=7
- aSOFTWARE_WHIP_NAME[$software_id]='FFmpeg'
- aSOFTWARE_WHIP_DESC[$software_id]='audio & visual libary'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=4
+ aSOFTWARE_NAME[$software_id]='FFmpeg'
+ aSOFTWARE_DESC[$software_id]='audio & visual libary'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=4
#------------------
software_id=8
- aSOFTWARE_WHIP_NAME[$software_id]='Java'
- aSOFTWARE_WHIP_DESC[$software_id]='OpenJDK + JRE libary'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=4
+ aSOFTWARE_NAME[$software_id]='Java'
+ aSOFTWARE_DESC[$software_id]='OpenJDK + JRE libary'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=4
#------------------
software_id=9
- aSOFTWARE_WHIP_NAME[$software_id]='Node.js'
- aSOFTWARE_WHIP_DESC[$software_id]='javascript runtime'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=4
+ aSOFTWARE_NAME[$software_id]='Node.js'
+ aSOFTWARE_DESC[$software_id]='javascript runtime'
aSOFTWARE_TYPE[$software_id]=1
- #------------------
- software_id=130
-
- aSOFTWARE_WHIP_NAME[$software_id]='Python Pip'
- aSOFTWARE_WHIP_DESC[$software_id]='python pip package installer'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
- aSOFTWARE_TYPE[$software_id]=1
#------------------
- software_id=140
+ software_id=130
- aSOFTWARE_WHIP_NAME[$software_id]='SDL2'
- aSOFTWARE_WHIP_DESC[$software_id]='simple direct layer 2'
+ aSOFTWARE_NAME[$software_id]='Python Pip'
+ aSOFTWARE_DESC[$software_id]='python pip package installer'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=1
- SOFTWARE_REQUIRES_XSERVERXORG[$software_id]=1
-
- # - ARMv8
- aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,3]=0
#------------------
software_id=150
- aSOFTWARE_WHIP_NAME[$software_id]='Mono'
- aSOFTWARE_WHIP_DESC[$software_id]='runtime libraries and repo'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=4
+ aSOFTWARE_NAME[$software_id]='Mono'
+ aSOFTWARE_DESC[$software_id]='runtime libraries and repo'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=4
#------------------
software_id=126
- aSOFTWARE_WHIP_NAME[$software_id]='LibSSL1.0.0'
- aSOFTWARE_WHIP_DESC[$software_id]='backwards compatibility (stretch+)'
+ aSOFTWARE_NAME[$software_id]='LibSSL1.0.0'
+ aSOFTWARE_DESC[$software_id]='backwards compatibility (stretch+)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=4
aSOFTWARE_TYPE[$software_id]=1
@@ -2216,50 +1986,50 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=10
- aSOFTWARE_WHIP_NAME[$software_id]='iftop'
- aSOFTWARE_WHIP_DESC[$software_id]='displays bandwidth usage information'
+ aSOFTWARE_NAME[$software_id]='iftop'
+ aSOFTWARE_DESC[$software_id]='displays bandwidth usage information'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=11
- aSOFTWARE_WHIP_NAME[$software_id]='IPTraf'
- aSOFTWARE_WHIP_DESC[$software_id]='interactive colorful ip lan monitor'
+ aSOFTWARE_NAME[$software_id]='IPTraf'
+ aSOFTWARE_DESC[$software_id]='interactive colorful ip lan monitor'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=12
- aSOFTWARE_WHIP_NAME[$software_id]='Iperf'
- aSOFTWARE_WHIP_DESC[$software_id]='internet protocol bandwidth measuring tool'
+ aSOFTWARE_NAME[$software_id]='Iperf'
+ aSOFTWARE_DESC[$software_id]='internet protocol bandwidth measuring tool'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=13
- aSOFTWARE_WHIP_NAME[$software_id]='MTR-Tiny'
- aSOFTWARE_WHIP_DESC[$software_id]='full screen ncurses traceroute tool'
+ aSOFTWARE_NAME[$software_id]='MTR-Tiny'
+ aSOFTWARE_DESC[$software_id]='full screen ncurses traceroute tool'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=14
- aSOFTWARE_WHIP_NAME[$software_id]='nLoad'
- aSOFTWARE_WHIP_DESC[$software_id]='realtime console network usage monitor'
+ aSOFTWARE_NAME[$software_id]='nLoad'
+ aSOFTWARE_DESC[$software_id]='realtime console network usage monitor'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=15
- aSOFTWARE_WHIP_NAME[$software_id]='tcpdump'
- aSOFTWARE_WHIP_DESC[$software_id]='command-line network traffic analyzer'
+ aSOFTWARE_NAME[$software_id]='tcpdump'
+ aSOFTWARE_DESC[$software_id]='command-line network traffic analyzer'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=152
- aSOFTWARE_WHIP_NAME[$software_id]='Avahi-Daemon'
- aSOFTWARE_WHIP_DESC[$software_id]='hostname broadcast (mac, pc bonjour)'
+ aSOFTWARE_NAME[$software_id]='Avahi-Daemon'
+ aSOFTWARE_DESC[$software_id]='hostname broadcast (mac, pc bonjour)'
aSOFTWARE_CATEGORY_INDEX[$software_id]=5
aSOFTWARE_TYPE[$software_id]=1
@@ -2267,129 +2037,121 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#--------------------------------------------------------------------------------
software_id=16
- aSOFTWARE_WHIP_NAME[$software_id]='Build-Essentials'
- aSOFTWARE_WHIP_DESC[$software_id]='common packages for compile'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=6
+ aSOFTWARE_NAME[$software_id]='Build-Essentials'
+ aSOFTWARE_DESC[$software_id]='common packages for compile'
aSOFTWARE_TYPE[$software_id]=1
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=6
#------------------
software_id=17
- aSOFTWARE_WHIP_NAME[$software_id]='Git Client'
- aSOFTWARE_WHIP_DESC[$software_id]='git clone etc'
+ aSOFTWARE_NAME[$software_id]='Git Client'
+ aSOFTWARE_DESC[$software_id]='git clone etc'
aSOFTWARE_CATEGORY_INDEX[$software_id]=6
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=170
- aSOFTWARE_WHIP_NAME[$software_id]='Unrar'
- aSOFTWARE_WHIP_DESC[$software_id]='unarchiver for .rar files'
- aSOFTWARE_CATEGORY_INDEX[$software_id]=6
+ aSOFTWARE_NAME[$software_id]='UnRAR'
+ aSOFTWARE_DESC[$software_id]='unarchiver for .rar files'
aSOFTWARE_TYPE[$software_id]=1
- #------------------
+ aSOFTWARE_CATEGORY_INDEX[$software_id]=6
# Text Editors
#--------------------------------------------------------------------------------
software_id=18
- aSOFTWARE_WHIP_NAME[$software_id]='Emacs'
- aSOFTWARE_WHIP_DESC[$software_id]='gnu emacs editor'
+ aSOFTWARE_NAME[$software_id]='Emacs'
+ aSOFTWARE_DESC[$software_id]='gnu emacs editor'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=19
- aSOFTWARE_WHIP_NAME[$software_id]='Jed'
- aSOFTWARE_WHIP_DESC[$software_id]='editor for programmers'
+ aSOFTWARE_NAME[$software_id]='Jed'
+ aSOFTWARE_DESC[$software_id]='editor for programmers'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=20
- aSOFTWARE_WHIP_NAME[$software_id]='Vim'
- aSOFTWARE_WHIP_DESC[$software_id]='vi enhanced text editor'
+ aSOFTWARE_NAME[$software_id]='Vim'
+ aSOFTWARE_DESC[$software_id]='vi enhanced text editor'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=21
- aSOFTWARE_WHIP_NAME[$software_id]='Vim-Tiny'
- aSOFTWARE_WHIP_DESC[$software_id]='compact release of vim'
+ aSOFTWARE_NAME[$software_id]='Vim-Tiny'
+ aSOFTWARE_DESC[$software_id]='compact release of vim'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=1
#------------------
software_id=127
- aSOFTWARE_WHIP_NAME[$software_id]='NeoVim'
- aSOFTWARE_WHIP_DESC[$software_id]='heavily refactored vim fork'
+ aSOFTWARE_NAME[$software_id]='NeoVim'
+ aSOFTWARE_DESC[$software_id]='heavily refactored vim fork'
aSOFTWARE_CATEGORY_INDEX[$software_id]=7
aSOFTWARE_TYPE[$software_id]=1
- # - Jessie
- aSOFTWARE_AVAIL_G_DISTRO[$software_id,3]=0
- #------------------
-
# Desktop Utilities
#--------------------------------------------------------------------------------
software_id=22
- aSOFTWARE_WHIP_NAME[$software_id]='QuiteRSS'
- aSOFTWARE_WHIP_DESC[$software_id]='cross-platform, free rss reader'
+ aSOFTWARE_NAME[$software_id]='QuiteRSS'
+ aSOFTWARE_DESC[$software_id]='cross-platform, free rss reader'
aSOFTWARE_CATEGORY_INDEX[$software_id]=8
aSOFTWARE_TYPE[$software_id]=1
aSOFTWARE_REQUIRES_DESKTOP[$software_id]=1
- #------------------
#--------------------------------------------------------------------------------
# Logging (hidden)
#--------------------------------------------------------------------------------
software_id=101
- aSOFTWARE_WHIP_NAME[$software_id]='Log Rotate'
- aSOFTWARE_WHIP_DESC[$software_id]='rotates log files'
+ aSOFTWARE_NAME[$software_id]='Log Rotate'
+ aSOFTWARE_DESC[$software_id]='rotates log files'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68'
#------------------
software_id=102
- aSOFTWARE_WHIP_NAME[$software_id]='Rsyslog'
- aSOFTWARE_WHIP_DESC[$software_id]='system logging'
+ aSOFTWARE_NAME[$software_id]='Rsyslog'
+ aSOFTWARE_DESC[$software_id]='system logging'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68'
#------------------
software_id=103
- aSOFTWARE_WHIP_NAME[$software_id]='DietPi-RAMlog'
- aSOFTWARE_WHIP_DESC[$software_id]='minimal, optimised logging'
+ aSOFTWARE_NAME[$software_id]='DietPi-RAMlog'
+ aSOFTWARE_DESC[$software_id]='minimal, optimised logging'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=68#p68'
- #------------------
#--------------------------------------------------------------------------------
# SSH servers (hidden from install menu)
#--------------------------------------------------------------------------------
software_id=104
- aSOFTWARE_WHIP_NAME[$software_id]='Dropbear'
- aSOFTWARE_WHIP_DESC[$software_id]='lightweight ssh server'
+ aSOFTWARE_NAME[$software_id]='Dropbear'
+ aSOFTWARE_DESC[$software_id]='lightweight ssh server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=62#p62'
#------------------
software_id=105
- aSOFTWARE_WHIP_NAME[$software_id]='OpenSSH Server'
- aSOFTWARE_WHIP_DESC[$software_id]='feature rich ssh server'
+ aSOFTWARE_NAME[$software_id]='OpenSSH Server'
+ aSOFTWARE_DESC[$software_id]='feature rich ssh server'
aSOFTWARE_CATEGORY_INDEX[$software_id]=0
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_ONLINEDOC_URL[$software_id]='p=63#p63'
- #------------------
#--------------------------------------------------------------------------------
# Init install state for defined software
- for i in ${!aSOFTWARE_WHIP_NAME[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
aSOFTWARE_INSTALL_STATE[$i]=0
@@ -2407,17 +2169,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it
# Disable software installation, if user input is required for automated installs
Install_Disable_Requires_UserInput(){
- if (( ! $G_USER_INPUTS )); then
+ if (( ! $G_INTERACTIVE )); then
- for i in ${!aSOFTWARE_INSTALL_STATE[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 && ${aSOFTWARE_REQUIRES_USERINPUT[$i]:-0} == 1 )); then
# - Disable
aSOFTWARE_INSTALL_STATE[$i]=0
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$i]}: Install requires user input and cannot be automated."
- G_DIETPI-NOTIFY 1 "${aSOFTWARE_WHIP_NAME[$i]}: Please run 'dietpi-software' to install manually."
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$i]}: Install requires user input and cannot be automated."
+ G_DIETPI-NOTIFY 1 "${aSOFTWARE_NAME[$i]}: Please run 'dietpi-software' to install manually."
fi
@@ -2438,6 +2200,16 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#-------------------------------------------------------------------------
# Pre-req software, for items that do NOT have their own array aSOFTWARE_REQUIRES_SOFTWARENAME
+ # Prevent Docker install if kernel has just been upgraded and old one overwritten/purged: https://github.com/MichaIng/DietPi/issues/3126
+ if [[ ${aSOFTWARE_INSTALL_STATE[162]} == 1 && ! -d /lib/modules/$(uname -r) ]]; then
+
+ G_WHIP_MSG '[WARNING] Docker install will be deselected\n
+It seems that your kernel version has just been upgraded. The mismatch between loaded and installed kernel versions would cause a failure during Docker install.\n
+Please reselect Docker from dietpi-software after next reboot.'
+ aSOFTWARE_INSTALL_STATE[162]=0
+
+ fi
+
# Nextcloud extensions
# - Nextcloud Talk
software_id=114
@@ -2445,7 +2217,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[$software_id]} < 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2454,17 +2226,17 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_INSTALL_STATE[61]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
- # Additional software that requires VNC4 Server
+ # Additional software that requires TigerVNC
# - XRDP: https://github.com/MichaIng/DietPi/issues/1727
software_id=28
- if (( $G_DISTRO > 3 && ${aSOFTWARE_INSTALL_STATE[29]} == 1 )); then
+ if (( ${aSOFTWARE_INSTALL_STATE[29]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2474,7 +2246,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_INSTALL_STATE[166]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2499,7 +2271,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then
aSOFTWARE_INSTALL_STATE[69]=1 # RPi.GPIO
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[69]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[69]} will be installed"
#aSOFTWARE_INSTALL_STATE[130]=1 # python-pip, enabled in #Software that requires Python-Pip
fi
@@ -2513,25 +2285,29 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[163]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
- # Software that requires LibSSL1.0.0, Stretch+ only
- # - Jackett (147)
- if (( $G_DISTRO > 3 )); then
+ # Software that requires LibSSL1.0.0
+ # - WiFi Hotspot (60, our custom compiled RTL8188C* binaries only)
+ # Check for RTL8188C* device, which requires a different driver: https://github.com/pritambaral/hostapd-rtl871xdrv#why
+ if (( ${aSOFTWARE_INSTALL_STATE[60]} == 1 )) && lsusb | grep -qi 'RTL8188C'; then
- software_id=126
- if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[60]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[97]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[134]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then
+ WIFIHOTSPOT_RTL8188C_DEVICE=1
+ # Some repos (e.g. ARMbian) provide special packages
+ apt-cache show hostapd-realtek &> /dev/null && WIFIHOTSPOT_RTL8188C_PACKAGE=1
- aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ fi
+ # - Jackett (147)
+ software_id=126
+ if (( ${aSOFTWARE_INSTALL_STATE[37]} == 1 ||
+ ( ${aSOFTWARE_INSTALL_STATE[60]} == 1 && $WIFIHOTSPOT_RTL8188C_DEVICE && ! $WIFIHOTSPOT_RTL8188C_PACKAGE && $G_HW_ARCH < 4 ) ||
+ ${aSOFTWARE_INSTALL_STATE[134]} == 1 ||
+ ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then
- fi
+ aSOFTWARE_INSTALL_STATE[$software_id]=1
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2544,16 +2320,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
( ${aSOFTWARE_INSTALL_STATE[147]} == 1 && $G_HW_ARCH == 1 ) )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
-
- fi
-
- # Software that requires SDL2:
- software_id=140
- if (( ${aSOFTWARE_INSTALL_STATE[108]} == 1 )); then
-
- aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2571,7 +2338,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2587,7 +2354,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[148]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2599,11 +2366,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[114]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
- # Software that requires unrar
+ # Software that requires UnRAR
# - rTorrent
# - Medusa
# - SABnzbd
@@ -2613,7 +2380,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[139]} == 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2677,7 +2444,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
#-------------------------------------------------------------------------
# Pre-req software, for items that DO have their own array aSOFTWARE_REQUIRES_SOFTWARENAME
- for i in ${!aSOFTWARE_INSTALL_STATE[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
(( ${aSOFTWARE_INSTALL_STATE[$i]} != 1 )) && continue
@@ -2719,7 +2486,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_PHP[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2728,7 +2495,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_MYSQL[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2737,7 +2504,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_SQLITE[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2749,11 +2516,11 @@ DietPi-Software will decrypt and use it for software installs. You can change it
${aSOFTWARE_INSTALL_STATE[26]} < 1 &&
${aSOFTWARE_INSTALL_STATE[173]} < 1 )); then
- # - If no desktop is selected or installed (0), default to LXDE
+ # If no desktop is selected or installed, default to LXDE
aSOFTWARE_INSTALL_STATE[23]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[23]} will be installed"
- # Pretent software requiring Xserver, to mark it below, in case desktop ID already passed:
+ # Pretent software requiring Xserver, to mark it below, in case desktop ID already passed
aSOFTWARE_REQUIRES_XSERVERXORG[$i]=1
fi
@@ -2763,7 +2530,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_GIT[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
# BUILDESSENTIAL
@@ -2771,7 +2538,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_BUILDESSENTIAL[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2780,7 +2547,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_RSYSLOG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
# FFMPEG
@@ -2788,7 +2555,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_FFMPEG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2797,7 +2564,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_JAVA_JRE_JDK[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2806,7 +2573,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_NODEJS[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2815,7 +2582,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_ALSA[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2824,7 +2591,7 @@ DietPi-Software will decrypt and use it for software installs. You can change it
if (( ${aSOFTWARE_REQUIRES_XSERVERXORG[$i]:=0} && aSOFTWARE_INSTALL_STATE[$software_id] != 1 )); then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} will be installed"
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} will be installed"
fi
@@ -2891,74 +2658,72 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
Create_Desktop_Shared_Items(){
- # - Pre-create dirs
- mkdir -p /root/Desktop
- mkdir -p /usr/share/applications
- mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/icons
- mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers
+ # Pre-create dirs
+ mkdir -p /root/Desktop /usr/share/applications
+ mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/{icons,wallpapers}
- # - Copy DietPi favourite links
+ # Copy DietPi favourite links
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/gtk/.gtk-bookmarks -O /root/.gtk-bookmarks
- # - DietPi Apps to download
+ # DietPi apps to download
local adesktop_items=(
- 'dietpi-software.desktop'
- 'dietpi-drive_manager.desktop'
- 'dietpi-update.desktop'
- 'dietpi-config.desktop'
- 'dietpi-backup.desktop'
- 'dietpi-sync.desktop'
- #'dietpi-bugreport.desktop'
- 'dietpi-services.desktop'
- 'dietpi-cleaner.desktop'
- 'dietpi-cron.desktop'
- 'dietpi-launcher.desktop'
- 'dietpi-justboom.desktop'
-
- 'es2_info.desktop'
- 'es2_gears.desktop'
- 'glx_info.desktop'
- 'glx_gears.desktop'
+ 'dietpi-software'
+ 'dietpi-drive_manager'
+ 'dietpi-update'
+ 'dietpi-config'
+ 'dietpi-backup'
+ 'dietpi-sync'
+ #'dietpi-bugreport'
+ 'dietpi-services'
+ 'dietpi-cleaner'
+ 'dietpi-cron'
+ 'dietpi-launcher'
+ 'dietpi-justboom'
+
+ 'es2_info'
+ 'es2_gears'
+ 'glx_info'
+ 'glx_gears'
)
for i in ${adesktop_items[@]}
do
- G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i -O /usr/share/applications/$i
+ G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/$i.desktop -O /usr/share/applications/$i.desktop
done
- unset adesktop_items
-
- # - Icons
+ # Icons
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/dietpi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/grey_16x16.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/grey_16x16.png
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/icons/justboom.png -O /var/lib/dietpi/dietpi-software/installed/desktop/icons/justboom.png
- # - Wallpapers
+ # Wallpapers
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_inverted_1080p.png -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_inverted_1080p.png
G_THREAD_START wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/wallpapers/dietpi-logo_1080p.png -O /var/lib/dietpi/dietpi-software/installed/desktop/wallpapers/dietpi-logo_1080p.png
G_THREAD_WAIT
- # - Desktop app symlinks
+ # Desktop app symlinks
ln -sf /usr/share/applications/htop.desktop /root/Desktop/htop.desktop
ln -sf /usr/share/applications/dietpi-software.desktop /root/Desktop/dietpi-software.desktop
ln -sf /usr/share/applications/dietpi-config.desktop /root/Desktop/dietpi-config.desktop
ln -sf /usr/share/applications/dietpi-launcher.desktop /root/Desktop/dietpi-launcher.desktop
+ # Permissions
+ # - Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops.
+ chmod +x /usr/share/applications/*.desktop
+
}
Create_UserContent_Folders(){
- 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
-
+ mkdir -p $G_FP_DIETPI_USERDATA/{$FOLDER_MUSIC,$FOLDER_PICTURES,$FOLDER_VIDEO,$FOLDER_DOWNLOADS}
+ chown dietpi:dietpi $G_FP_DIETPI_USERDATA/{$FOLDER_MUSIC,$FOLDER_PICTURES,$FOLDER_VIDEO,$FOLDER_DOWNLOADS}
+ chmod 775 $G_FP_DIETPI_USERDATA/{$FOLDER_MUSIC,$FOLDER_PICTURES,$FOLDER_VIDEO,$FOLDER_DOWNLOADS}
mkdir -p /var/www
}
@@ -3075,8 +2840,8 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
local url=$1
[[ ! $url && $fallback_url ]] && url=$fallback_url
local target=$2 # Extract target
- local type=${url##*.} # Grab ext from URL | compatbile with >> deb|zip|tar(.gz|.bz2)|7z
- [[ $type == 'gz' || $type == 'bz2' ]] && type='tar'
+ local type=${url##*.} # Grab ext from URL | compatbile with >> deb|zip|tar(.gz|.bz2)|tgz|tbz2|7z
+ [[ $type =~ ^t?(gz|bz2)$ ]] && type='tar'
local file="$software_id.$type"
# DietPi-Software conf/service mode
@@ -3094,7 +2859,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
# Download file
if [[ $DEPS_LIST ]]; then
- # - Download as background thread if dependencies are to be installed
+ # Download as background thread if dependencies are to be installed
G_THREAD_START wget "$url" -O $file
G_AGI $DEPS_LIST
DEPS_LIST=''
@@ -3109,17 +2874,17 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
# Process downloaded file
if [[ $type == dps_index ]]; then
- # - Pre-create dir
+ # Pre-create dir
local fp_dir=${target%/*}
[[ -d $fp_dir ]] || G_RUN_CMD mkdir -p "$fp_dir"
- [[ -f $target ]] && G_WHIP_MSG "[ INFO ] Updating file: $target"
+ [[ -f $target ]] && G_DIETPI-NOTIFY 2 "Updating file: $target"
G_RUN_CMD mv $file "$target"
elif [[ $type == 'deb' ]]; then
- # - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies
- G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file
+ # Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies
+ G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file
(( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF
elif [[ $type == 'zip' ]]; then
@@ -3129,8 +2894,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
elif [[ $type == 'tar' ]]; then
- #[[ $target ]] && target="--one-top-level=$target" # Option exist not on Jessie
- [[ $target ]] && G_RUN_CMD mkdir -p "$target" && target="-C $target"
+ [[ $target ]] && target="--one-top-level=$target"
G_RUN_CMD tar xf $file "$target"
elif [[ $type == '7z' ]]; then
@@ -3169,8 +2933,8 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
G_AGI lxde upower policykit-1 firefox-esr
#upower policykit-1. Needed for LXDE logout menu item to show shutdown/restart ...
- # - RPi, revert to Debian pcmanfm install package: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173
- if (( $G_HW_MODEL < 10 )); then
+ # - RPi Stretch, revert to Debian pcmanfm install package: https://github.com/MichaIng/DietPi/issues/1558#issuecomment-390328173
+ if (( $G_HW_MODEL < 10 && $G_DISTRO == 4 )); then
Download_Install 'https://dietpi.com/downloads/binaries/all/pcmanfm_1.2.5-3_armhf.deb'
apt-mark hold pcmanfm
@@ -3255,6 +3019,12 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
+ # On Stretch, use backports, which resolves missing /etc/profile (e.g. $PATH) load and failing install+service if IPv6 is disabled: https://github.com/MichaIng/DietPi/issues/3017
+ (( $G_DISTRO == 4 )) && cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp
+Package: xrdp
+Pin: release n=stretch-backports
+Pin-Priority: 500
+_EOF_
G_AGI xrdp
fi
@@ -3316,13 +3086,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
-
- local package_list='nfs-kernel-server rpcbind'
-
- # On Jessie, nfs-kernel-server does not depend on netbase, which is needed for NFS server to start: https://packages.debian.org/jessie/nfs-kernel-server
- (( $G_DISTRO < 4 )) && package_list+=' netbase'
-
- G_AGI $package_list
+ G_AGI nfs-kernel-server rpcbind
fi
@@ -3331,8 +3095,8 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
Banner_Installing
local package_list='apache2'
- # - Install certbot module on Stretch+, if certbot was already installed
- (( ${aSOFTWARE_INSTALL_STATE[92]} == 2 && $G_DISTRO > 3 )) && package_list+=' python-certbot-apache'
+ # Install certbot module on Stretch+, if certbot was already installed
+ (( ${aSOFTWARE_INSTALL_STATE[92]} == 2 )) && package_list+=' python3-certbot-apache'
G_AGI $package_list
fi
@@ -3342,8 +3106,8 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
Banner_Installing
local package_list='nginx-light'
- # - Install certbot module on Stretch+, if certbot was already installed
- (( ${aSOFTWARE_INSTALL_STATE[92]} == 2 && $G_DISTRO > 3 )) && package_list+=' python-certbot-nginx'
+ # Install certbot module on Stretch+, if certbot was already installed
+ (( ${aSOFTWARE_INSTALL_STATE[92]} == 2 )) && package_list+=' python3-certbot-nginx'
G_AGI $package_list
fi
@@ -3352,7 +3116,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
- # - NB: RPi | Perl required, else 'lighttpd-enable-mod fastcgi' = Can't locate Term/ReadLine.pm
+ # perl is required for lighttpd-enable-mod, it has been added to recommends only with Buster.
G_AGI lighttpd perl
fi
@@ -3362,7 +3126,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
Banner_Installing
- G_DIETPI-NOTIFY 2 'Preparing database folder'
+ G_DIETPI-NOTIFY 2 "Preparing database directory at: $G_FP_DIETPI_USERDATA/mysql"
if [[ -d $G_FP_DIETPI_USERDATA/mysql ]]; then
G_DIETPI-NOTIFY 2 "$G_FP_DIETPI_USERDATA/mysql exists, will migrate containing databases"
@@ -3370,38 +3134,36 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
else
# Otherwise use possibly existent /var/lib/mysql
# - Remove possible dead symlinks/files:
- rm $G_FP_DIETPI_USERDATA/mysql &> /dev/null
- mkdir -p $G_FP_DIETPI_USERDATA/mysql
+ G_RUN_CMD rm -f $G_FP_DIETPI_USERDATA/mysql
if [[ -d '/var/lib/mysql' ]]; then
G_DIETPI-NOTIFY 2 '/var/lib/mysql exists, will migrate containing databases'
- G_RUN_CMD cp -a /var/lib/mysql/. $G_FP_DIETPI_USERDATA/mysql
+ # Failsafe: Move symlink target in case, otherwise readlink will resolve to dir
+ G_RUN_CMD mv $(readlink -f '/var/lib/mysql') $G_FP_DIETPI_USERDATA/mysql
+
+ else
+
+ G_RUN_CMD mkdir $G_FP_DIETPI_USERDATA/mysql
fi
fi
- G_DIETPI-NOTIFY 2 'Removing /var/lib/mysql, if existent'
- [[ -L '/var/lib/mysql' && ! $(readlink /var/lib/mysql) =~ $G_FP_DIETPI_USERDATA/mysql ]] &&
- rm -R "$(readlink /var/lib/mysql)" &> /dev/null
- rm -R /var/lib/mysql &> /dev/null
-
- l_message="Creating symlink: /var/lib/mysql -> $G_FP_DIETPI_USERDATA/mysql" G_RUN_CMD ln -sf $G_FP_DIETPI_USERDATA/mysql /var/lib/mysql
- chown mysql:mysql -h /var/lib/mysql &> /dev/null
- chown mysql:mysql -RL /var/lib/mysql &> /dev/null
+ G_RUN_CMD rm -Rf /var/lib/mysql
+ G_RUN_CMD ln -s $G_FP_DIETPI_USERDATA/mysql /var/lib/mysql
local package_list='mariadb-server'
# Install php-mysql module, if PHP was already installed
(( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-mysql"
- G_AGI "$package_list"
+ G_AGI $package_list
- # - Remove mysql.service as we use mariadb.service, both cannot exist: https://github.com/MichaIng/DietPi/issues/1913#issuecomment-441343798
- if [[ -f '/etc/init.d/mysql' ]] && (( $G_DISTRO > 3 )); then
+ # Remove obsolete sysvinit service as we use the systemd mariadb.service
+ if [[ -f '/etc/init.d/mysql' ]]; then
G_DIETPI-NOTIFY 2 'Switching from /etc/init.d/mysql to mariadb.service'
- systemctl stop mysql
+ systemctl disable --now mysql
rm /etc/init.d/mysql
- systemctl daemon-reload
+ update-rc.d -f mysql remove
fi
@@ -3414,7 +3176,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
local package_list='sqlite3'
# Install php-sqlite module, if PHP was already installed
(( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-sqlite3"
- G_AGI "$package_list"
+ G_AGI $package_list
fi
@@ -3427,19 +3189,6 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
(( ${aSOFTWARE_INSTALL_STATE[89]} == 2 )) && package_list+=" $PHP_NAME-redis"
G_AGI $package_list
- # Fix wrong permissions from Jessie package: https://github.com/MichaIng/DietPi/issues/2736
- # - /run/redis is created but on boot as well with wrong root:root permissions, so we need to fix that via ExecStartPre
- if (( $G_DISTRO < 4 )); then
-
- mkdir -p /etc/systemd/system/redis-server.service.d
- echo "[Service]
-PermissionsStartOnly=true
-ExecStartPre=$(command -v mkdir) -p /run/redis /var/lib/redis
-ExecStartPre=$(command -v chown) -R redis:redis /run/redis /var/lib/redis" > /etc/systemd/system/redis-server.service.d/dietpi-fix_permissions.conf
- systemctl daemon-reload
-
- fi
-
fi
software_id=89 # PHP
@@ -3447,7 +3196,7 @@ ExecStartPre=$(command -v chown) -R redis:redis /run/redis /var/lib/redis" > /et
Banner_Installing
- # Jessie + Stretch: Add Ondrejs PHP repository for latest PHP version (currently PHP7.3)
+ # Stretch: Add Ondrejs PHP repository for latest PHP version (currently PHP7.3)
if (( $G_DISTRO < 5 )); then
# - Debian (+sury.org) armhf is not ARMv6 compatible: https://github.com/MichaIng/DietPi/issues/2794
@@ -3456,8 +3205,6 @@ ExecStartPre=$(command -v chown) -R redis:redis /run/redis /var/lib/redis" > /et
INSTALL_URL_ADDRESS='http://raspbian.raspberrypi.org/raspbian'
# - Actually we do not support any non-RPi ARMv6 devices currently, but lets be failsafe here
(( $G_HW_MODEL > 9 )) && INSTALL_URL_ADDRESS='https://deb.debian.org/debian/'
- # - Jessie does not like https://deb.debian.org
- (( $G_DISTRO < 4 )) && INSTALL_URL_ADDRESS=${INSTALL_URL_ADDRESS/https/http}
# - APT source
echo "deb $INSTALL_URL_ADDRESS buster main" > /etc/apt/sources.list.d/dietpi-php.list
@@ -3471,32 +3218,6 @@ Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/d
else
- # Jessie: https://github.com/MichaIng/DietPi/issues/1620#issuecomment-373086888
- if (( $G_DISTRO < 4 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/libssl1.1_1.1.0f-3+deb9u1_'
-
- # - ARMv7
- if (( $G_HW_ARCH < 3 )); then
-
- INSTALL_URL_ADDRESS+='armhf.deb'
-
- # - ARM64
- elif (( $G_HW_ARCH == 3 )); then
-
- INSTALL_URL_ADDRESS+='arm64.deb'
-
- # - x86_64
- elif (( $G_HW_ARCH == 10 )); then
-
- INSTALL_URL_ADDRESS+='amd64.deb'
-
- fi
-
- Download_Install "$INSTALL_URL_ADDRESS"
-
- fi
-
# - Check URL
INSTALL_URL_ADDRESS='https://packages.sury.org/php/apt.gpg'
G_CHECK_URL "$INSTALL_URL_ADDRESS"
@@ -3504,7 +3225,7 @@ Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/d
curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
# - APT source
echo "deb https://packages.sury.org/php/ $G_DISTRO_NAME main" > /etc/apt/sources.list.d/dietpi-php.list
- # - Pin down libssl1.1 version from this repo on Jessie and Stretch: https://github.com/MichaIng/DietPi/issues/2734
+ # - Pin down libssl1.1 version from this repo on Stretch: https://github.com/MichaIng/DietPi/issues/2734
echo -e '# libssl1.1 from sury.org breaks Lighttpd install
Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-openssl
@@ -3555,7 +3276,7 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et
Banner_Installing
# MariaDB must be running during install to allow debconf setup.
- G_RUN_CMD systemctl start $MARIADB_SERVICE
+ G_RUN_CMD systemctl start mariadb
# Set password parameters before installing
debconf-set-selections <<< 'phpmyadmin phpmyadmin/dbconfig-install boolean true'
@@ -3572,7 +3293,7 @@ Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /et
# Workaround an APT error, when installing lighttpd and phpmyadmin in the same session: https://github.com/MichaIng/DietPi/issues/316
G_ERROR_HANDLER_NO_FAIL=1 G_AGI phpmyadmin
G_WHIP_MSG 'Working around Lighttpd + phpMyAdmin APT errors:\n\nYou may have seen an error during the phpMyAdmin APT installation. This occurs, when Lighttpd webserver was installed within the same session.\n
-We work around this error by running APT a second time. Please do not worry and ignore any error or failure message within this install steps. After DietPi-Software finished, Lighttpd should start up and phpMyAdmin web UI should be available as expected.'
+We work around this error by running APT a second time. Please do not worry and ignore any error or failure message within these install steps. After DietPi-Software finished, Lighttpd should start up and phpMyAdmin web UI should be available as expected.'
else
@@ -3589,24 +3310,8 @@ We work around this error by running APT a second time. Please do not worry and
Banner_Installing
- # Jessie-
- if (( $G_DISTRO < 4 )); then
-
- # MPD not available in Jessie repo for ARMv8
- if (( $G_HW_ARCH == 3 )); then
-
- # libupnp6 for net discov with upnp/avahi
- DEPS_LIST='libupnp6 libwrap0 libmpdclient2 libao-common libao4 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 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'
- Download_Install 'https://dietpi.com/downloads/binaries/all/mpd_0.20.23-1_aarch64.deb'
-
- else
-
- G_AGI mpd
-
- fi
-
# Stretch
- elif (( $G_DISTRO == 4 )); then
+ if (( $G_DISTRO < 5 )); then
DEPS_LIST='libnfs8 libsmbclient libsqlite3-0 libupnp6 libwrap0 libmpdclient2 libflac8 libyajl2 libavahi-client3 libvorbisfile3 libwavpack1 libmad0 libmpg123-0 libopus0 libavformat57 libfaad2 libcdio-paranoia1 libiso9660-8 libshout3 libid3tag0'
Download_Install "https://dietpi.com/downloads/binaries/all/mpd_0.20.23-1_$G_HW_ARCH_DESCRIPTION.deb"
@@ -3632,8 +3337,8 @@ We work around this error by running APT a second time. Please do not worry and
# Skip install, if already present
if [[ -d '/var/www/phpBB3' ]]; then
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/var/www/phpBB3\" already exists. Download and install steps will be skipped.
- - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please follow the instructions from WebUI ACP.
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"/var/www/phpBB3\" already exists. Download and install steps will be skipped.
+ - If you want to update ${aSOFTWARE_NAME[$software_id]}, please follow the instructions from WebUI ACP.
- if you need to reinstall (e.g. broken instance), please manually backup your config files+data, remove the install dir and rerun \"dietpi-software (re)install $software_id\"."
else
@@ -3679,7 +3384,7 @@ _EOF_
. /etc/bashrc.d/go.sh
# Install OpenBazaar
- G_DIETPI-NOTIFY 2 "Installing ${aSOFTWARE_WHIP_NAME[$software_id]}, please wait, this will take some time (1-5 minutes)"
+ G_DIETPI-NOTIFY 2 "Installing ${aSOFTWARE_NAME[$software_id]}, please wait, this will take some time (1-5 minutes)"
G_RUN_CMD go get github.com/OpenBazaar/openbazaar-go
fi
@@ -3735,7 +3440,7 @@ _EOF_
if [[ -f $datadir/dietpi-owncloud-installation-backup/occ ]]; then
G_DIETPI-NOTIFY 2 'ownCloud installation backup found, starting recovery...'
- G_RUN_CMD cp -a "$datadir"/dietpi-owncloud-installation-backup/. /var/www/owncloud
+ G_RUN_CMD cp -a "$datadir"/dietpi-owncloud-installation-backup/. /var/www/owncloud/
# Correct config.php data directory entry, in case it changed due to server migration:
G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/owncloud/config/config.php "'dbtype'"
@@ -3749,7 +3454,7 @@ _EOF_
chown -R www-data:www-data /var/www/owncloud
- [[ $DEPS_LIST ]] && G_DIETPI-NOTIFY 2 'Installing required PHP modules' && G_AGI "$DEPS_LIST"
+ [[ $DEPS_LIST ]] && G_DIETPI-NOTIFY 2 'Installing required PHP modules' && G_AGI $DEPS_LIST
fi
@@ -3770,7 +3475,7 @@ _EOF_
if [[ -f $datadir/dietpi-nextcloud-installation-backup/occ ]]; then
G_DIETPI-NOTIFY 2 'Nextcloud installation backup found, starting recovery...'
- G_RUN_CMD cp -a "$datadir"/dietpi-nextcloud-installation-backup/. /var/www/nextcloud
+ G_RUN_CMD cp -a "$datadir"/dietpi-nextcloud-installation-backup/. /var/www/nextcloud/
# Correct config.php data directory entry, in case it changed due to server migration:
G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/nextcloud/config/config.php "'dbtype'"
@@ -3784,7 +3489,7 @@ _EOF_
chown -R www-data:www-data /var/www/nextcloud
- [[ $DEPS_LIST ]] && G_DIETPI-NOTIFY 2 'Installing required PHP modules' && G_AGI "$DEPS_LIST"
+ [[ $DEPS_LIST ]] && G_DIETPI-NOTIFY 2 'Installing required PHP modules' && G_AGI $DEPS_LIST
fi
@@ -3803,32 +3508,6 @@ _EOF_
Banner_Installing
- # Jessie: https://github.com/MichaIng/DietPi/issues/1620#issuecomment-373086888
- if (( $G_DISTRO == 3 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/libssl1.1_1.1.0f-3+deb9u1_'
-
- # - ARMv7
- if (( $G_HW_ARCH < 3 )); then
-
- INSTALL_URL_ADDRESS+='armhf.deb'
-
- # - ARM64
- elif (( $G_HW_ARCH == 3 )); then
-
- INSTALL_URL_ADDRESS+='arm64.deb'
-
- # - x86_64
- elif (( $G_HW_ARCH == 10 )); then
-
- INSTALL_URL_ADDRESS+='amd64.deb'
-
- fi
-
- Download_Install "$INSTALL_URL_ADDRESS"
-
- fi
-
Download_Install 'https://dietpi.com/downloads/binaries/all/ympd_1.2.3.7z'
local binary_name='ympd_'
@@ -3854,16 +3533,8 @@ _EOF_
fi
- # Buster workaround, since we have no Buster binaries yet
- if (( $G_DISTRO > 3 )); then
-
- binary_name+='_stretch'
-
- else
-
- binary_name+="_$G_DISTRO_NAME"
-
- fi
+ # We have no Buster binaries yet, so always use Stretch binaries
+ binary_name+='_stretch'
mv $binary_name /usr/bin/ympd
chmod +x /usr/bin/ympd
@@ -3877,14 +3548,13 @@ _EOF_
Banner_Installing
# Sourcebuild pre-reqs: https://github.com/jcorporation/myMPD#dependencies
- DEPS_LIST='libmpdclient2 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev'
-
+ DEPS_LIST='libmpdclient2 libmediainfo0v5 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev'
Download_Install 'https://github.com/jcorporation/myMPD/archive/master.zip'
- cd myMPD*
- G_RUN_CMD ./mkrelease.sh
+ cd myMPD-master
+ G_RUN_CMD ./build.sh releaseinstall
cd /tmp/$G_PROGRAM_NAME
- rm -R myMPD*
+ rm -R myMPD-master
fi
@@ -3967,16 +3637,8 @@ _EOF_
[[ -f '/etc/mopidy/mopidy.conf' ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf
curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
- # No Buster list available yet, use stretch.list for testing:
- if (( $G_DISTRO > 3 )); 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
+ # No bullseye.list available yet, use buster.list instead
+ wget https://apt.mopidy.com/${G_DISTRO_NAME/bullseye/buster}.list -O /etc/apt/sources.list.d/mopidy.list
G_AGUP
G_AGI mopidy gstreamer1.0-alsa
@@ -3999,39 +3661,44 @@ _EOF_
Banner_Installing
- # Odroids
- if (( $G_HW_MODEL > 9 )) && (( $G_HW_MODEL < 20 )); then
+ # CEC support + libcurl3-gnutls required for C2, but lets apply to all: https://github.com/MichaIng/DietPi/issues/446
+ local package_list='libcec4 libcurl3-gnutls'
- local package_list='kodi-odroid'
+ # NFS support
+ (( $G_DISTRO < 5 )) && package_list+=' libnfs8' || package_list+=' libnfs12'
+
+ # Odroids
+ if [[ $G_HW_MODEL == 1[0-9] ]]; then
- # - XU4: Requires pulse audio (fixes corrupt sound)
- (( $G_HW_MODEL == 11 )) && package_list+=' pulseaudio'
+ package_list+=' kodi-odroid'
# Everything else
else
- local package_list='kodi'
+ package_list+=' kodi'
- # - RPi: Kodi 18 requires fbset to start with custom screen resolution: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550
- (( $G_HW_MODEL < 10 )) && package_list+=' fbset'
+ # RPi
+ if (( $G_HW_MODEL < 10 )); then
- fi
+ # fbset required to recover desktop with custom resolution and fix startup warning: https://dietpi.com/phpbb/viewtopic.php?p=17550#p17550
+ package_list+=' fbset'
- # - libcurl3-gnutls required for C2. But lets apply to all: https://github.com/MichaIng/DietPi/issues/446
- package_list+=' libcurl3-gnutls'
+ # RPi4: fake KMS driver required: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=251645
+ if (( $G_HW_MODEL == 4 )); then
- # - NFS/CEC support
- if (( $G_DISTRO < 4 )); then
+ /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d
- package_list+=' libnfs4 libcec3v4'
+ # Else legacy (non-GL) driver required
+ else
- elif (( $G_DISTRO == 4 )); then
+ /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl disable
- package_list+=' libnfs8 libcec4'
+ fi
- else
+ # https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241
+ mkdir -p /etc/polkit-1/localauthority/50-local.d
- package_list+=' libnfs12 libcec4'
+ fi
fi
@@ -4082,10 +3749,79 @@ _EOF_
Banner_Installing
- # Backup existing autostart.uae for user
- G_BACKUP_FP $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae
+ # Pre-reqs
+ DEPS_LIST='libmpg123-0 libxml2 mpeg2dec libmpeg2-4'
+
+ # For Stretch, SDL2 was compiled with X11 + libsndio support and dependency
+ if (( $G_DISTRO < 5 )); then
+
+ DEPS_LIST+=' libsndio6.1'
+
+ # ARMv6
+ if (( $G_HW_ARCH == 1 )); then
+
+ INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv6_stretch.7z'
+
+ # ARMv7 FKMS: ./configure --disable-video-rpi --enable-video-kmsdrm
+ elif (( $G_HW_ARCH == 2 )); then
- DEPS_LIST='libmpg123-0 libxml2 mpeg2dec libmpeg2-4 libsndio6.1'
+ INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv7_stretch.7z'
+
+ # RPi 2/3 Enable fkms OpenGL
+ (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d
+
+ fi
+
+ Download_Install "$INSTALL_URL_ADDRESS" sdl2
+ dpkg -i sdl2/*.deb
+ rm -R sdl2
+
+ # For Buster, SDL2 was compiled with minimum dependencies: No X11 required, thus GPU drivers and some libraries need to be installed/enabled separately
+ else
+
+ # Libraries
+ DEPS_LIST+=' libpng16-16 libfreetype6'
+
+ # GPU drivers
+ # - RPi
+ if (( $G_HW_MODEL < 10 )); then
+
+ DEPS_LIST+=' libegl1'
+ /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d
+
+ # - Odroid XU4: http://fuzon.co.uk/meveric/pool/main/s/setup-odroid/
+ elif (( $G_HW_MODEL == 11 )); then
+
+ DEPS_LIST+=' malit628-odroid'
+
+ # - ASUS TB: https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/armhf
+ elif (( $G_HW_MODEL == 52 )); then
+
+ # Mali-T760 driver libraries
+ Download_Install 'https://dietpi.com/downloads/binaries/asus/libmali.deb'
+ cd /usr/lib/arm-linux-gnueabihf
+ ln -sf libMali.so libEGL.so.1.1.0
+ ln -sf libMali.so libEGL.so
+ ln -sf libMali.so libEGL.so.1.0.0
+ ln -sf libMali.so libEGL.so.1.4
+ ln -sf libMali.so libGLESv2.so
+ ln -sf libMali.so libGLESv2.so.2.0
+ ln -sf libMali.so libGLESv2.so.2.0.0
+ ln -sf libMali.so libGLESv1_CM.so
+ ln -sf libMali.so libGLESv1_CM.so.1
+ ln -sf libMali.so libGLESv1_CM.so.1.1
+ cd /tmp/$G_PROGRAM_NAME
+
+ fi
+
+ # libSDL2
+ Download_Install "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/libSDL2_$G_HW_ARCH_DESCRIPTION.tar.bz2" /usr/local/lib
+
+ fi
+
+ # Amiberry
+ # - Backup existing autostart.uae for user
+ G_BACKUP_FP $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae
Download_Install 'https://dietpi.com/downloads/binaries/all/amiberry_v2.25.7z' $G_FP_DIETPI_USERDATA
fi
@@ -4174,7 +3910,7 @@ _EOF_
DEPS_LIST='ibsdl1.2debian libsdl-net1.2'
Download_Install 'https://dietpi.com/downloads/binaries/rpi/opentyrian_armhf.zip' /
- cp -R /usr/local/games/opentyrian /usr/games/ # cp 'just does it', mv will fail if already exists.
+ cp -a /usr/local/games/opentyrian /usr/games/ # cp 'just does it', mv will fail if already exists.
rm -R /usr/local/games/opentyrian
chmod +x /usr/games/opentyrian/opentyrian
@@ -4201,7 +3937,7 @@ _EOF_
# Setup /var/www/rpicam
mkdir -p /var/www/rpicam/media
- cp -R www/* /var/www/rpicam/
+ cp -a www/* /var/www/rpicam/
#chmod +x /var/www/rpicam/raspizip.sh
mknod /var/www/rpicam/FIFO p
mknod /var/www/rpicam/FIFO1 p
@@ -4234,8 +3970,12 @@ _EOF_
Banner_Installing
- DEPS_LIST='perl python'
- Download_Install 'http://www.webmin.com/download/deb/webmin-current.deb'
+ INSTALL_URL_ADDRESS='http://www.webmin.com/jcameron-key.asc'
+ G_CHECK_URL "$INSTALL_URL_ADDRESS"
+ curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
+ echo 'deb https://download.webmin.com/download/repository sarge contrib' > /etc/apt/sources.list.d/webmin.list
+ G_AGUP
+ G_AGI webmin
fi
@@ -4279,7 +4019,7 @@ _EOF_
Download_Install 'https://github.com/afaqurk/linux-dash/archive/master.zip'
mkdir -p /var/www/linuxdash
- cp -R linux-dash-master/* /var/www/linuxdash
+ cp -a linux-dash-master/* /var/www/linuxdash/
rm -R linux-dash-master
fi
@@ -4293,8 +4033,8 @@ _EOF_
G_CHECK_URL "$INSTALL_URL_ADDRESS"
# Check free available memory. Increase swapfile size to prevent gravity running out of mem.
- if (( $(free -m | mawk '/Mem:/ {print $4;exit}') < 512 &&
- $(grep -m1 '^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') < 512 )); then
+ if (( $(free -m | mawk '/^Mem:/{print $4;exit}') < 512 &&
+ $(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) < 512 )); then
G_DIETPI-NOTIFY 2 'Increasing swapfile size to 512 MiB before running gravity.sh, please wait...\n'
/DietPi/dietpi/func/dietpi-set_swapfile 512
@@ -4304,7 +4044,7 @@ _EOF_
# Install
wget "$INSTALL_URL_ADDRESS" -O install.sh
chmod +x install.sh
- # - Skip Lighttpd install, since user properly has chosen a different one, which was installed as pre-req.
+ # - Skip Lighttpd install, since we allow to choose and install prior to Pi-hole
./install.sh --disable-install-webserver
# - We can't do reasonable exit code check, since installer always returns 5!
rm install.sh
@@ -4484,14 +4224,6 @@ _EOF_
# Packages
local apackages=()
- # - Jessie: Requires Stretch packages
- if (( $G_DISTRO < 4 )); then
-
- apackages+=("https://dietpi.com/downloads/binaries/jessie/gcc-6-base_$G_HW_ARCH_DESCRIPTION.deb")
- apackages+=("https://dietpi.com/downloads/binaries/jessie/libstdc++6_$G_HW_ARCH_DESCRIPTION.deb")
-
- fi
-
# - ARMv6/7
if (( $G_HW_ARCH < 3 )); then
@@ -4643,25 +4375,15 @@ _EOF_
fi
- software_id=27 # TightVNC Server
- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
-
- Banner_Installing
- G_AGI tightvncserver x11vnc
-
- fi
-
- software_id=28 # VNC4 Server
+ software_id=28 # TigerVNC Server
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
-
- local package_list='vnc4server x11vnc'
-
- # Stretch+
- (( $G_DISTRO > 3 )) && package_list+=' tigervnc-common'
-
- G_AGI $package_list
+ # TigerVNC allows connecting to a virtual desktop
+ # X11VNC allows connecting to a real desktop session, thus shared desktop sessions as well
+ # netbase is required to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver"
+ # - It is a recommendation and no dependency of perl, but expected by some packages depending on perl only: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939055
+ G_AGI tigervnc-standalone-server tigervnc-common x11vnc netbase
fi
@@ -4669,8 +4391,6 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
-
- # Available in Raspbian APT repo
G_AGI realvnc-vnc-server
fi
@@ -4684,37 +4404,31 @@ _EOF_
mkdir -p /etc/fail2ban
[[ -f '/etc/fail2ban/jail.conf' ]] || cat << _EOF_ > /etc/fail2ban/jail.conf
[DEFAULT]
+enabled = true
ignoreip = 127.0.0.1/8
ignorecommand =
-bantime = 600
-findtime = 600
-maxretry = 3
backend = systemd
-enabled = true
filter = %(__name__)s
-port = 0:65535
+findtime = 600
+maxretry = 3
+bantime = 600
banaction = route
-action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s"]
-action = %(action_)s
-
-[sshd]
-port = ssh
+action = %(banaction)s[blocktype=blackhole]
[dropbear]
-port = ssh
-_EOF_
- if (( $G_DISTRO > 3 )); then
-
- G_AGI python3-systemd fail2ban
+[sshd]
+_EOF_
- # On Jessie, the systemd backend is not yet supported, so we install the Stretch package manually
- else
+ G_AGI python3-systemd fail2ban
- DEPS_LIST='python3-systemd'
- Download_Install 'https://dietpi.com/downloads/binaries/all/fail2ban.deb'
+ # Remove obsolete sysvinit service and traces
+ rm -f /etc/{init.d,default}/fail2ban
+ update-rc.d -f fail2ban remove
- fi
+ # Failsafe
+ G_RUN_CMD systemctl unmask fail2ban
+ G_RUN_CMD systemctl enable --now fail2ban
fi
@@ -4727,7 +4441,8 @@ _EOF_
G_CHECK_URL "$INSTALL_URL_ADDRESS"
curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
- echo "deb https://repos.influxdata.com/debian $G_DISTRO_NAME stable" > /etc/apt/sources.list.d/influxdb.list
+ # Use Buster branch on Bullseye
+ echo "deb https://repos.influxdata.com/debian/ ${G_DISTRO_NAME/bullseye/buster} stable" > /etc/apt/sources.list.d/influxdb.list
G_AGUP
G_AGI influxdb
@@ -4741,11 +4456,11 @@ _EOF_
# APT repo GPG key
INSTALL_URL_ADDRESS='https://packages.grafana.com/gpg.key'
- local deb_address='deb https://packages.grafana.com/oss/deb stable main'
+ local deb_address='deb https://packages.grafana.com/oss/deb/ stable main'
if (( $G_HW_ARCH == 1 )); then
INSTALL_URL_ADDRESS='https://bintray.com/user/downloadSubjectPublicKey?username=bintray'
- deb_address="deb https://dl.bintray.com/fg2it/deb-rpi-1b $G_DISTRO_NAME main"
+ deb_address="deb https://dl.bintray.com/fg2it/deb-rpi-1b/ $G_DISTRO_NAME main"
fi
@@ -4821,7 +4536,10 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
- G_AGI openvpn easy-rsa iptables
+ G_AGI openvpn iptables
+ # Remove obsolete sysvinit service
+ [[ -f '/etc/init.d/openvpn' ]] && rm /etc/init.d/openvpn
+ update-rc.d -f openvpn remove
fi
@@ -4836,7 +4554,7 @@ _EOF_
G_AGI lsb-release iptables-persistent dnsutils expect net-tools openvpn
# Requires underpriv user: https://github.com/MichaIng/DietPi/issues/570#issuecomment-255588307
- useradd pivpn
+ getent passwd pivpn &> /dev/null || useradd pivpn
mkdir -p /home/pivpn
wget "$INSTALL_URL_ADDRESS" -O pivpn_install.sh
@@ -4878,11 +4596,6 @@ _EOF_
kernel_packages='raspberrypi-bootloader raspberrypi-kernel libraspberrypi-bin libraspberrypi0 raspberrypi-kernel-headers'
- # - Odroid C1: REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- kernel_packages='linux-image-armhf-odroid-c1 linux-headers-armhf-odroid-c1'
-
# - Odroid XU4
elif (( $G_HW_MODEL == 11 )); then
@@ -4911,17 +4624,23 @@ _EOF_
# Since G_AGUG does not upgrade packages with changed dependencies, in case of kernel image meta packages, those need to be installed+upgraded via G_AGI.
G_AGI $kernel_packages # apt-get install overrides hold state
- # Add Debian "sid" repo, which contains the WireGuard packages
- echo 'deb https://deb.debian.org/debian/ sid main' > /etc/apt/sources.list.d/dietpi-wireguard.list
- # - Disable sid repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568
- # - Enable but set sid WireGuard package priorities low enough to install only if not available in main repo(s)
- echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n
-Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard
+ # Add Bullseye repo, which contains the WireGuard packages
+ if (( $G_DISTRO < 6 )); then
- # RPi: Install debian-archive-keyring, currently version 2018.1 from sid branch: https://packages.debian.org/de/sid/debian-archive-keyring
- (( $G_HW_MODEL < 10 )) && Download_Install 'https://dietpi.com/downloads/binaries/rpi/debian-archive-keyring.deb'
+ # Raspbian or Debian?
+ local url='http://raspbian.raspberrypi.org/raspbian/'
+ (( $G_HW_MODEL > 9 )) && url='https://deb.debian.org/debian/'
- G_AGUP
+ echo "deb $url bullseye main" > /etc/apt/sources.list.d/dietpi-wireguard.list
+
+ # Disable repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568
+ # Enable but set WireGuard package priorities low enough to install only if not available in main repo(s)
+ echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n
+Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard
+
+ G_AGUP
+
+ fi
# Check for existing WireGuard install
local existing_install=0
@@ -4934,6 +4653,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
# If existing install, reconfigure to rebuild WireGuard kernel module against current kernel + headers
(( $existing_install )) && G_RUN_CMD dpkg-reconfigure wireguard-dkms
+ # On RPi, the kernel module rebuild is not triggered by kernel upgrades, thus add this task manually
+ (( $G_HW_MODEL > 9 )) || echo -e '#!/bin/dash\ndpkg-reconfigure wireguard-dkms' > /etc/kernel/postinst.d/dietpi-wireguard
+
unset kernel_packages existing_install
fi
@@ -4957,34 +4679,17 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- if (( $G_DISTRO > 3 )); then
-
- if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then
-
- G_AGI certbot python-certbot-apache
-
- elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then
-
- G_AGI certbot python-certbot-nginx
+ if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then
- else
+ G_AGI certbot python3-certbot-apache
- G_AGI certbot
+ elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then
- fi
+ G_AGI certbot python3-certbot-nginx
else
- # - Remove/Update existing certbot installer scripts
- [[ -d '/etc/certbot_scripts' ]] && rm -R /etc/certbot_scripts
-
- Download_Install 'https://github.com/certbot/certbot/archive/master.zip' /etc
- mv /etc/certbot* /etc/certbot_scripts
-
- # - Install packages
- cd /etc/certbot_scripts
- ./certbot-auto -n --os-packages-only
- cd /tmp/$G_PROGRAM_NAME
+ G_AGI certbot
fi
@@ -4996,53 +4701,61 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
DEPS_LIST='hostapd isc-dhcp-server iptables libnl-3-200'
- Download_Install 'https://dietpi.com/downloads/binaries/all/hostapd_2.5_all.zip'
- # - Check for RTL8188C* device, use the patched binary I compiled: https://github.com/pritambaral/hostapd-rtl871xdrv#why
- if lsusb | grep -qi 'RTL8188C' || (( $G_HW_MODEL == 70 )); then #Force RTL for allo provided WiFi dongle
+ # RTL8188C* device if RTL package is available
+ if (( $WIFIHOTSPOT_RTL8188C_DEVICE && $WIFIHOTSPOT_RTL8188C_PACKAGE )); then
- WIFIHOTSPOT_RTL8188C_DEVICE=1
+ G_AGI ${DEPS_LIST/hostapd/hostapt-realtek}
- fi
+ # Else use our compiled binaries (for all but x86_64)
+ elif (( $WIFIHOTSPOT_RTL8188C_DEVICE && $G_HW_ARCH < 4 )); then
- # Which binary to install
- local filename_hostapd=''
- local filename_hostapd_cli=''
+ Download_Install 'https://dietpi.com/downloads/binaries/all/hostapd_2.5_all.zip'
- # - armv6
- if (( $G_HW_ARCH == 1 )); then
+ # Which binary to install
+ local filename_hostapd=''
+ local filename_hostapd_cli=''
- filename_hostapd='hostapd-nl80211-armv6'
- (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-armv6'
- filename_hostapd_cli='hostapd_cli-armv6'
+ # ARMv6
+ if (( $G_HW_ARCH == 1 )); then
- # - armv7+
- elif (( $G_HW_ARCH == 2 )); then
+ filename_hostapd='hostapd-rtl8188c-armv6'
+ filename_hostapd_cli='hostapd_cli-armv6'
- filename_hostapd='hostapd-nl80211-armv7'
- (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-armv7'
- filename_hostapd_cli='hostapd_cli-armv7'
+ # ARMv7
+ elif (( $G_HW_ARCH == 2 )); then
- # - arm64
- elif (( $G_HW_ARCH == 3 )); then
+ filename_hostapd='hostapd-rtl8188c-armv7'
+ filename_hostapd_cli='hostapd_cli-armv7'
+
+ # ARMv8
+ elif (( $G_HW_ARCH == 3 )); then
- filename_hostapd='hostapd-nl80211-arm64'
- (( $WIFIHOTSPOT_RTL8188C_DEVICE )) && filename_hostapd='hostapd-rtl8188c-arm64'
- filename_hostapd_cli='hostapd_cli-arm64'
+ filename_hostapd='hostapd-rtl8188c-arm64'
+ filename_hostapd_cli='hostapd_cli-arm64'
- fi
+ fi
- mv "$filename_hostapd" /usr/sbin/hostapd
- mv "$filename_hostapd_cli" /usr/sbin/hostapd_cli
+ mv "$filename_hostapd" /usr/sbin/hostapd
+ mv "$filename_hostapd_cli" /usr/sbin/hostapd_cli
+ chmod +x /usr/sbin/hostapd{,_cli}
- chmod +x /usr/sbin/hostapd
- chmod +x /usr/sbin/hostapd_cli
+ rm hostapd-*
- rm hostapd-*
+ # In all other cases install the default package.
+ # NB: Debian Stretch ships an older version then our own compiled binaries, but many device/firmware repos (RPi, Meveric, ARMbian) ship newer ones even for Stretch, thus we should not overwrite them anymore.
+ else
+
+ G_AGI $DEPS_LIST
+
+ fi
- # Enable wifi modules
+ # Enable WiFi modules
/DietPi/dietpi/func/dietpi-set_hardware wifimodules enable
+ # Unmask hostapd service: https://github.com/MichaIng/DietPi/issues/2962
+ G_RUN_CMD systemctl unmask hostapd
+
fi
software_id=61 # Tor Hotspot
@@ -5078,9 +4791,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
# Skip install, if already present
if [[ -d /var/www/pydio ]]; then
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/var/www/pydio\" already exists. Download and install steps will be skipped.
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"/var/www/pydio\" already exists. Download and install steps will be skipped.
- Please manually backup your config files+data, remove the install dir and rerun \"dietpi-software (re)install $software_id\" if you need to reinstall.
- - If you want to update the ${aSOFTWARE_WHIP_NAME[$software_id]} instance, please use the internal updater from WebUI."
+ - If you want to update the ${aSOFTWARE_NAME[$software_id]} instance, please use the internal updater from WebUI."
G_AGI $DEPS_LIST
unset DEPS_LIST
@@ -5160,12 +4873,24 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- # Netdata v1.12 available on Debian stretch-backports and Raspbian/Debian Buster
- # => Only install our custom package on Jessie and RPi Stretch
- if (( $G_DISTRO < 4 || ( $G_HW_MODEL < 10 && $G_DISTRO < 5 ) )); then
+ # No package available on Stretch
+ if (( $G_DISTRO < 5 )); then
+
+ # For ARMv6 RPi use our self-compiled package
+ if (( $G_HW_ARCH == 1 )); then
+
+ DEPS_LIST='zlib1g-dev'
+ Download_Install 'https://dietpi.com/downloads/binaries/all/netdata_1.11.1-1_armv6l.deb'
+
+ # Else use the packages from Debian Stretch backports snapshot, that were removed recently, hosted now on dietpi.com
+ else
- DEPS_LIST='zlib1g-dev'
- Download_Install "https://dietpi.com/downloads/binaries/all/netdata_1.11.1-1_$G_HW_ARCH_DESCRIPTION.deb"
+ Download_Install "https://dietpi.com/downloads/binaries/stretch/netdata_$G_HW_ARCH_DESCRIPTION.7z"
+ dpkg --force-hold,confdef,confold -i netdata{-core,-plugins-bash,-web,}_*.deb
+ G_AGF
+ rm netdata*
+
+ fi
else
@@ -5180,8 +4905,18 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- Download_Install 'https://github.com/fruux/Baikal/archive/master.zip' /var/www
- mv /var/www/Baikal* /var/www/baikal
+ # Pre-reqs: https://github.com/sabre-io/Baikal/wiki/Baïkal-dependencies
+ DEPS_LIST="$PHP_NAME-xml $PHP_NAME-mbstring $PHP_NAME-mysql"
+
+ Download_Install 'https://github.com/fruux/Baikal/archive/master.zip'
+ # Reinstall: http://sabre.io/baikal/upgrade/
+ if [[ -d '/var/www/baikal' ]]; then
+
+ cp -a /var/www/baikal/Specific/. Baikal-master/Specific/
+ rm -R /var/www/baikal
+
+ fi
+ mv Baikal-master /var/www/baikal
fi
@@ -5234,7 +4969,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
# Apply APT repo
- echo 'deb https://downloads.plex.tv/repo/deb public main' > /etc/apt/sources.list.d/plexmediaserver.list
+ echo 'deb https://downloads.plex.tv/repo/deb/ public main' > /etc/apt/sources.list.d/plexmediaserver.list
# Update APT lists
G_AGUP
@@ -5307,26 +5042,44 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gogs_'
-
- #armv6
+ # ARMv6: No pre-compiled binaries available, thus we use our own: https://github.com/gogs/gogs/releases
if (( $G_HW_ARCH == 1 )); then
- INSTALL_URL_ADDRESS+='armv6.zip'
+ INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gogs_armv6.zip'
- #armv7+
- elif (( $G_HW_ARCH == 2 )); then
+ # Else install latest binaries from GitHub
+ else
- INSTALL_URL_ADDRESS+='armv7.zip'
+ # ARMv7
+ local file='raspi2_armv6.zip'
+ local fallback_url='https://github.com/gogs/gogs/releases/download/v0.11.86/raspi2_armv6.zip'
- #x86_64
- elif (( $G_HW_ARCH == 10 )); then
+ # x86_64
+ if (( $G_HW_ARCH == 10 )); then
+
+ file='linux_amd64.tar.gz'
+ fallback_url='https://github.com/gogs/gogs/releases/download/v0.11.86/linux_amd64.tar.gz'
+
+ fi
+
+ G_CHECK_URL 'https://api.github.com/repos/gogs/gogs/releases/latest'
+ INSTALL_URL_ADDRESS=$(curl -s 'https://api.github.com/repos/gogs/gogs/releases/latest' | grep -m1 "browser_download_url.*$file" | cut -d \" -f 4)
+ local no_check_url=1 # G_CHECK_URL faces 403
+
+ fi
+
+ Download_Install "$INSTALL_URL_ADDRESS"
+
+ # Remove old install dir, but preserve existing configs
+ if [[ -d '/etc/gogs' ]]; then
+
+ [[ -d '/etc/gogs/custom' ]] && mv /etc/gogs/custom gogs
+ mv /etc/gogs/.??* gogs # dot files = SSH and Git user configs
+ rm -R /etc/gogs
- INSTALL_URL_ADDRESS+='amd64.zip'
fi
- Download_Install "$INSTALL_URL_ADDRESS" /etc
- mv /etc/gogs* /etc/gogs
+ mv gogs /etc/gogs
fi
@@ -5346,8 +5099,6 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
DEPS_LIST='rtorrent mediainfo'
# On Buster, no "screen" is required to run rTorrent as daemon: https://github.com/rakshasa/rtorrent/wiki/Daemon_Mode
(( $G_DISTRO < 5 )) && DEPS_LIST+=' screen'
- # On Jessie, nginx-full is required for SCGI module: https://github.com/MichaIng/DietPi/issues/1240
- (( $G_DISTRO < 4 && ${aSOFTWARE_INSTALL_STATE[85]} > 0 )) && DEPS_LIST+=' nginx-full'
# Install ruTorrent: Web UI for rTorrent
# - Get current version string
@@ -5383,51 +5134,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- if (( $G_DISTRO > 3 )); then
-
- G_AGI aria2
-
- else
-
- # aria2c binary
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/aria2_'
-
- # - armv6
- if (( $G_HW_ARCH == 1 )); then
-
- INSTALL_URL_ADDRESS+='armv6.7z'
+ G_AGI aria2
- # - armv7+
- elif (( $G_HW_ARCH == 2 )); then
-
- INSTALL_URL_ADDRESS+='armv7.7z'
-
- # - arm64
- elif (( $G_HW_ARCH == 3 )); then
-
- INSTALL_URL_ADDRESS+='arm64.7z'
-
- # - x86_64
- elif (( $G_HW_ARCH == 10 )); then
-
- INSTALL_URL_ADDRESS+='x86_64.7z'
-
- fi
-
- # - prereqs
- DEPS_LIST='libc-ares2'
- Download_Install "$INSTALL_URL_ADDRESS"
-
- mv aria2_* /usr/local/bin/aria2c
- chmod +x /usr/local/bin/aria2c
-
- fi
-
- # Web interface
+ # Web UI: Settings are stored client-wise, web UI files are never written by webserver. Thus root:root 022 permissions existing dir removal on reinstall can be done.
Download_Install 'https://github.com/ziahamza/webui-aria2/archive/master.zip'
-
- cp -R webui-aria2-master /var/www/aria2
- rm -R webui-aria2-master
+ [[ -d '/var/www/aria2' ]] && rm -R /var/www/aria2
+ mv webui-aria2-master /var/www/aria2
fi
@@ -5436,14 +5148,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- DEPS_LIST='mediainfo python'
- (( $G_DISTRO > 3 )) && DEPS_LIST+='3'
+ DEPS_LIST='mediainfo python3'
if [[ -d $G_FP_DIETPI_USERDATA/medusa ]]; then
G_AGI $DEPS_LIST
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"$G_FP_DIETPI_USERDATA/medusa\" already exists. Download and install steps will be skipped.
- - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use the internal updater from WebUI.
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"$G_FP_DIETPI_USERDATA/medusa\" already exists. Download and install steps will be skipped.
+ - If you want to update ${aSOFTWARE_NAME[$software_id]}, please use the internal updater from WebUI.
- If you need to reinstall (e.g. broken instance), please manually backup your config files+data, remove the install dir and rerun \"dietpi-software (re)install $software_id\"."
else
@@ -5462,8 +5173,8 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
if [[ -d '/etc/syncthing' ]]; then
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/etc/syncthing\" already exists. Download and install steps will be skipped.
- - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use the internal updater from WebUI.
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"/etc/syncthing\" already exists. Download and install steps will be skipped.
+ - If you want to update ${aSOFTWARE_NAME[$software_id]}, please use the internal updater from WebUI.
- if you need to reinstall (e.g. broken instance), please manually backup your config files+data, remove the install dir \"/etc/syncthing\" and rerun \"dietpi-software (re)install $software_id\"."
else
@@ -5515,7 +5226,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
elif (( $G_HW_ARCH == 10 )); then
INSTALL_URL_ADDRESS1='https://dietpi.com/downloads/binaries/all/libjpeg8_8d1-2_amd64.deb'
- (( $G_DISTRO > 3 )) && INSTALL_URL_ADDRESS2='https://dietpi.com/downloads/binaries/all/libpng12-0_1.2.50-2+deb8u3_amd64.deb' || DEPS_LIST+=' libpng12-0'
+ INSTALL_URL_ADDRESS2='https://dietpi.com/downloads/binaries/all/libpng12-0_1.2.50-2+deb8u3_amd64.deb' || DEPS_LIST+=' libpng12-0'
INSTALL_URL_ADDRESS3='https://www.tonido.com/download.php?tonido64.tar.gz'
fi
@@ -5536,58 +5247,13 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
# Pre-reqs
G_AG_CHECK_INSTALL_PREREQ lsb-release
- # Stretch+ via APT
- if (( $G_DISTRO > 3 )); then
-
- if (( $G_HW_MODEL < 10 )); then
-
- G_AGI chromium-browser
-
- else
-
- G_AGI chromium
+ if (( $G_HW_MODEL < 10 )); then
- fi
+ G_AGI chromium-browser
else
- # ARMv6/7
- if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_armhf.deb'
-
- # ARMv8
- elif (( $G_HW_ARCH == 3 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/chromium_52.0.2743.116-1-deb8u1.1_arm64.deb'
-
- fi
-
- # Odroids, 'apt-get -f install' removes chromium package, rather than install required deps...
- if (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )); then
-
- DEPS_LIST='libgnome-keyring0 libnspr4 libnss3 libnss3-1d libspeechd2 libxslt1.1 libxss1 xdg-utils libgnome-keyring-common libltdl7'
-
- fi
-
- Download_Install "$INSTALL_URL_ADDRESS"
-
- Download_Install 'https://dietpi.com/downloads/binaries/all/chromium-l10n_52.0.2743.116-1-deb8u1.1_all.deb'
-
- # ARMv6/7
- if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then
-
- Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_armhf.deb'
-
- # ARMv8
- elif (( $G_HW_ARCH == 3 )); then
-
- Download_Install 'https://dietpi.com/downloads/binaries/all/chromedriver_52.0.2743.116-1-deb8u1.1_arm64.deb'
-
- fi
-
- # Prevent Debian repo from replacing our chromium packages: https://github.com/MichaIng/DietPi/issues/658
- apt-mark hold chromium chromedriver
+ G_AGI chromium
fi
@@ -5610,28 +5276,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
-
- if (( $G_DISTRO == 3 )); then # https://github.com/MichaIng/DietPi/issues/855#issuecomment-292712002
-
- # Apply APT key
- INSTALL_URL_ADDRESS='https://davesteele.github.io/key-366150CE.pub.txt'
- G_CHECK_URL "$INSTALL_URL_ADDRESS"
- curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
-
- # Apply APT repo
- echo 'deb https://davesteele.github.io/cloudprint-service/repo cloudprint-jessie main' > /etc/apt/sources.list.d/cloudprint.list
-
- # Update APT lists
- G_AGUP
-
- # Install CloudPrint
- G_AGI cloudprint-service
-
- else
-
- G_AGI cloudprint-service
-
- fi
+ G_AGI cloudprint-service
fi
@@ -5763,12 +5408,12 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
if (( $G_HW_ARCH == 3 )); then
DEPS_LIST='mediainfo'
- Download_Install 'https://update.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz' /opt
+ Download_Install 'https://download.sonarr.tv/v2/develop/mono/NzbDrone.develop.tar.gz' /opt
# Repo install
else
- apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493
echo 'deb https://apt.sonarr.tv/ develop main' > /etc/apt/sources.list.d/sonarr.list
G_AGUP
G_AGI nzbdrone
@@ -5810,11 +5455,11 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
Banner_Installing
- if [[ -d /opt/plexpy ]]; then
+ if [[ -d '/opt/plexpy' ]]; then
G_AGI python python-setuptools
- G_DIETPI-NOTIFY 2 "${aSOFTWARE_WHIP_NAME[$software_id]} install dir \"/opt/plexpy\" already exists. Download and install steps will be skipped.
- - If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use the internal updater from WebUI.
+ G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install dir \"/opt/plexpy\" already exists. Download and install steps will be skipped.
+ - If you want to update ${aSOFTWARE_NAME[$software_id]}, please use the internal updater from WebUI.
- if you need to reinstall (e.g. broken instance), please manually backup your config files+data, remove the install dir \"/opt/plexpy\" and rerun \"dietpi-software (re)install $software_id\"."
else
@@ -5867,18 +5512,14 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
if (( $G_HW_ARCH != 1 )); then
DEPS_LIST='liblttng-ust0'
- if (( $G_DISTRO < 4 )); then
+ if (( $G_DISTRO > 4 )); then
- DEPS_LIST+=' libicu52'
+ DEPS_LIST+=' libicu63'
- elif (( $G_DISTRO == 4 )); then
+ else
DEPS_LIST+=' libicu57'
- elif (( $G_DISTRO > 4 )); then
-
- DEPS_LIST+=' libicu63'
-
fi
fi
@@ -5935,7 +5576,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
# Move HTPC Manager to a 'better' location
mkdir -p $G_FP_DIETPI_USERDATA/htpc-manager
- cp -R HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/
+ cp -a HTPC-Manager/* $G_FP_DIETPI_USERDATA/htpc-manager/
rm -R HTPC-Manager
fi
@@ -5979,9 +5620,9 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Prior
else
G_WHIP_MSG "[WARNING] Existing install found\n
-The ${aSOFTWARE_WHIP_NAME[$software_id]} target install directory $G_FP_DIETPI_USERDATA/roonserver already exists. This will not be overwritten.\n
-If the existing instance is broken or obsolete, please manually backup config files and data, then remove this directory and rerun "dietpi-software".\n
-If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's internal updater."
+The ${aSOFTWARE_NAME[$software_id]} target install directory $G_FP_DIETPI_USERDATA/roonserver already exists. This will not be overwritten.\n
+If the existing instance is broken or obsolete, please manually backup config files and data, then remove this directory and rerun \"dietpi-software\".\n
+If you want to update ${aSOFTWARE_NAME[$software_id]}, please use it's internal updater."
fi
@@ -6034,6 +5675,7 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte
# Create default data directory & grant minio-user proper access
mkdir -p $G_FP_DIETPI_USERDATA/minio-data
+ chown -R minio-user:minio-user $G_FP_DIETPI_USERDATA/minio-data
fi
@@ -6042,28 +5684,22 @@ If you want to update ${aSOFTWARE_WHIP_NAME[$software_id]}, please use it's inte
Banner_Installing
+ # Offical installer
INSTALL_URL_ADDRESS='https://get.docker.com'
G_CHECK_URL "$INSTALL_URL_ADDRESS"
-
- # Current workaround for faulty docker-ce repo version on RPi: https://github.com/MichaIng/DietPi/issues/2282
- (( $G_HW_MODEL < 10 )) && echo 'Package: docker-ce docker-ce-cli
-Pin: version 5:18.09.0~3-0~raspbian-stretch
-Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
-
- # Offical Docker installer
wget "$INSTALL_URL_ADDRESS" -O DockerInstall.sh
chmod +x DockerInstall.sh
- ./DockerInstall.sh
- rm DockerInstall.sh
- # - Raspbian Buster branch is missing, so revert to Stretch: https://download.docker.com/linux/raspbian/dists/
- if (( $G_DISTRO > 4 && $G_HW_MODEL < 10 )) && ! G_ERROR_HANDLER_INFO_ONLY=1 G_USER_INPUTS=0 G_CHECK_URL 'https://download.docker.com/linux/raspbian/dists/buster/'; then
+ G_ERROR_HANDLER_COMMAND='./DockerInstall.sh'
+ G_ERROR_HANDLER_RETRY=1
+ while (( $G_ERROR_HANDLER_RETRY ))
+ do
- G_DIETPI-NOTIFY 2 'Docker repo misses a Raspbian Buster branch, reverting to Stretch...'
- sed -i 's/[[:blank:]]buster[[:blank:]]/ stretch /' /etc/apt/sources.list.d/docker.list
- G_AGUP
- G_AGI docker-ce docker-ce-cli
+ ./DockerInstall.sh
+ G_ERROR_HANDLER_EXITCODE=$?
+ G_ERROR_HANDLER
- fi
+ done
+ rm DockerInstall.sh
fi
@@ -6111,7 +5747,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
Banner_Installing
- INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.8/gitea-1.8-'
+ INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.9.4/gitea-1.9.4-'
# armv6
if (( $G_HW_ARCH == 1 )); then
@@ -6121,7 +5757,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
# armv7
elif (( $G_HW_ARCH == 2 )); then
- INSTALL_URL_ADDRESS+='linux-arm-7'
+ INSTALL_URL_ADDRESS+='linux-arm-6' # Workaround since ARMv7 binaries are missing/fail on v1.8.X: https://github.com/MichaIng/DietPi/issues/2959
# armv8
elif (( $G_HW_ARCH == 3 )); then
@@ -6159,7 +5795,7 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
Banner_Installing
- # Stretch + Jessie: Use our updated package
+ # Stretch: Use our updated package
if (( $G_DISTRO < 5 )); then
INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/gmrender_1_'
@@ -6209,13 +5845,13 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
software_id=167 # Raspotify
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
- Banner_Installing
+ Banner_Installing # https://dtcooper.github.io/raspotify/#hard-installation
INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc'
G_CHECK_URL "$INSTALL_URL_ADDRESS"
curl -sSL "$INSTALL_URL_ADDRESS" | apt-key add -
- echo 'deb https://dtcooper.github.io/raspotify jessie main' > /etc/apt/sources.list.d/raspotify.list
+ echo 'deb https://dtcooper.github.io/raspotify/ raspotify main' > /etc/apt/sources.list.d/raspotify.list
G_AGUP
G_AGI raspotify
@@ -6279,11 +5915,11 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
dps_index=$software_id Download_Install 'mycroft.conf' /etc/mycroft/mycroft.conf
# Create "mycroft" user with home=data dir beforehand, to have everything at right locations with right permissions directly
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd mycroft &> /dev/null && usercmd='usermod -a'
$usercmd -G audio -d $G_FP_DIETPI_USERDATA/mycroft-data -s $(command -v nologin) mycroft
mkdir -p $G_FP_DIETPI_USERDATA/mycroft-data
- chown -R mycroft:mycroft $G_FP_DIETPI_USERDATA/mycroft-core /etc/mycroft $G_FP_DIETPI_USERDATA/mycroft-data
+ chown -R mycroft:mycroft /etc/mycroft $G_FP_DIETPI_USERDATA/mycroft-{core,data}
# Force skills to be placed directly into data dir
rm -Rf /opt/mycroft
@@ -6342,20 +5978,19 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
Banner_Installing
- G_AGI alsa-utils
-
- # Apply soundcard
+ # Get chosen soundcard
local soundcard=$(grep -m1 '^[[:blank:]]*CONFIG_SOUNDCARD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
soundcard=${soundcard:-none}
- # - RPi enable internal HDMI+Analogue if currently set to 'none'
- if (( $G_HW_MODEL < 10 )) && [[ $soundcard == 'none' || $soundcard == 'default' ]]; then
+ # Enable defaults, if set to "none"
+ if [[ $soundcard == 'none' ]]; then
- soundcard='rpi-bcm2835-ultrahq'
+ # - RPi: Onboard auto, Others: default
+ (( $G_HW_MODEL < 10 )) && soundcard='rpi-bcm2835-auto' || soundcard='default'
fi
- # - Apply
+ # Apply: Installs "alsa-utils"
/DietPi/dietpi/func/dietpi-set_hardware soundcard "$soundcard"
fi
@@ -6366,32 +6001,28 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
Banner_Installing
# - Stretch+, libssl1.0.0 no longer available: https://github.com/MichaIng/DietPi/issues/1299
- if (( $G_DISTRO > 3 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/'
+ INSTALL_URL_ADDRESS='https://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
+ # - 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+='libssl1.0.0_1.0.1t-1+deb8u7_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+='libssl1.0.0_1.0.1t-1+deb8u7_arm64.deb'
- fi
+ # - x86_64
+ elif (( $G_HW_ARCH == 10 )); then
- DEPS_LIST='multiarch-support'
- Download_Install "$INSTALL_URL_ADDRESS"
+ INSTALL_URL_ADDRESS+='libssl1.0.0_1.0.1t-1+deb8u7_amd64.deb'
fi
+ DEPS_LIST='multiarch-support'
+ Download_Install "$INSTALL_URL_ADDRESS"
+
fi
software_id=6 # Xserver
@@ -6399,42 +6030,58 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
Banner_Installing
- # Xserver Prereqs (ALL)
- G_AGI xserver-xorg xinit xcompmgr xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra
+ # Assure libegl1-mesa transitional dummy package is skipped (on Stretch via backports) to avoid conflicts with 3rd party repos: https://github.com/MichaIng/DietPi/issues/1794#issuecomment-539138684
+ local libegl1='libegl1'
+ (( $G_DISTRO == 4 )) && libegl1+='/stretch-backports'
- # - Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions
+ # Xserver + generic Mesa OpenGL libraries and utilities
+ G_AGI $libegl1 xserver-xorg xinit xcompmgr xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils libgl1-mesa-dri mesa-utils mesa-utils-extra
+
+ # Improve performance on all desktops and devices (eg: removes window lag in desktops) by limiting compositions
dps_index=$software_id Download_Install 'xcompmgr.desktop' /etc/xdg/autostart/xcompmgr.desktop
- # - Disable DPMS and all screen blanking
+ # Disable DPMS and all screen blanking
dps_index=$software_id Download_Install '99-dietpi-dpms_off.conf' /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf
- # Odroid N1
- if (( $G_HW_MODEL == 14 )); then
+ # RK3399: https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/arm64
+ # - Odroid N1, RockPro64, NanoPC T4, Firefly RK3399, ROCK Pi 4
+ if (( $G_HW_CPUID == 3 )); then
+
+ # Mali-T864 driver library
+ Download_Install 'https://dietpi.com/downloads/binaries/rk3399/libmali.deb'
+ cd /usr/lib/aarch64-linux-gnu
+ ln -sf libMali.so libEGL.so.1.1.0
+ ln -sf libMali.so libEGL.so
+ ln -sf libMali.so libEGL.so.1.0.0
+ ln -sf libMali.so libEGL.so.1.4
+ ln -sf libMali.so libGLESv2.so
+ ln -sf libMali.so libGLESv2.so.2.0
+ ln -sf libMali.so libGLESv2.so.2.0.0
+ ln -sf libMali.so libGLESv1_CM.so
+ ln -sf libMali.so libGLESv1_CM.so.1
+ ln -sf libMali.so libGLESv1_CM.so.1.1
+ cd /tmp/$G_PROGRAM_NAME
- DEPS_LIST='libmali-rk-midgard-t86x-r14p0 xserver-xorg-video-armsoc-rk3399-odroid'
+ # X.org packages and config
+ Download_Install 'https://dietpi.com/downloads/binaries/rk3399/xserver.7z' xserver
+ dpkg --force-hold,confdef,confold -i xserver/*.deb
G_BACKUP_FP /etc/X11/xorg.conf
- dps_index=$software_id Download_Install 'xorg_n1.conf' /etc/X11/xorg.conf
+ dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf
- # Odroid C2
+ # Odroid C2: http://fuzon.co.uk/meveric/pool/main/s/setup-odroid/
elif (( $G_HW_MODEL == 12 )); then
- DEPS_LIST='aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump-odroid xf86-video-fbturbo-odroid'
+ DEPS_LIST='aml-libs-odroid mali450-odroid libump-odroid xf86-video-fbturbo-odroid'
G_BACKUP_FP /etc/X11/xorg.conf
dps_index=$software_id Download_Install 'xorg_c2.conf' /etc/X11/xorg.conf
- # Odroid XU4
+ # Odroid XU4: http://fuzon.co.uk/meveric/pool/main/s/setup-odroid/
elif (( $G_HW_MODEL == 11 )); then
+ # xf86-video-armsoc-odroid creates an xorg.conf
G_AGI firmware-samsung xf86-video-armsoc-odroid malit628-odroid
- # Odroid C1: REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- DEPS_LIST='aml-libs-odroid xf86-video-mali-odroid libump-odroid mali450-odroid'
- G_BACKUP_FP /etc/X11/xorg.conf
- dps_index=$software_id Download_Install 'xorg_c1.conf' /etc/X11/xorg.conf
-
- # Pine64
+ # Pine A64
elif (( $G_HW_MODEL == 40 )); then
Download_Install 'https://dietpi.com/downloads/binaries/all/libump_1-1_arm64.deb'
@@ -6443,61 +6090,30 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
G_BACKUP_FP /etc/X11/xorg.conf
dps_index=$software_id Download_Install 'xorg_pine64.conf' /etc/X11/xorg.conf
- # RK3399
- # elif (( $G_HW_MODEL == 42 || $G_HW_MODEL == 68 )); then
-
- # /usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/libglamoregl.so: undefined symbol: gbm_create_device
- # Retry with kernel/uboot from Ubuntu image???
-
- #dps_index=$software_id Download_Install 'xorg_rk3399.conf' /etc/X11/xorg.conf
- #dps_index=$software_id Download_Install '50-dietpi-rk3399.rules' /etc/udev/rules.d/50-rk3399.rules
-
- ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-x11-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so
- ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-fbdev.so -O /usr/lib/aarch64-linux-gnu/libMali.so
- ##wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0-gbm.so -O /usr/lib/aarch64-linux-gnu/libMali.so #works but no GLES
- #wget https://github.com/rockchip-linux/libmali/raw/29mirror/lib/aarch64-linux-gnu/libmali-midgard-t86x-r14p0.so -O /usr/lib/aarch64-linux-gnu/libMali.so
- #rm $(ls /usr/lib/aarch64-linux-gnu/libGLESv2.*)
- #rm $(ls /usr/lib/aarch64-linux-gnu/libEGL.*)
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libmali.so
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libMaliOpenCL.so
- #ln -sf /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libOpenCL.so
-
- # ASUS TB
+ # ASUS TB: https://github.com/rockchip-linux/rk-rootfs-build/tree/master/packages/armhf
elif (( $G_HW_MODEL == 52 )); then
- Download_Install 'https://dietpi.com/downloads/binaries/asus/ASUSTB_GPU.7z' gpu_driver
-
- cd gpu_driver
- dpkg -i *.deb
- G_AGF
-
- # - Hold GPU installed packages
- apt-mark hold xserver-common xserver-xorg-core
-
+ # Mali-T760 driver library
+ Download_Install 'https://dietpi.com/downloads/binaries/asus/libmali.deb'
+ cd /usr/lib/arm-linux-gnueabihf
+ ln -sf libMali.so libEGL.so.1.1.0
+ ln -sf libMali.so libEGL.so
+ ln -sf libMali.so libEGL.so.1.0.0
+ ln -sf libMali.so libEGL.so.1.4
+ ln -sf libMali.so libGLESv2.so
+ ln -sf libMali.so libGLESv2.so.2.0
+ ln -sf libMali.so libGLESv2.so.2.0.0
+ ln -sf libMali.so libGLESv1_CM.so
+ ln -sf libMali.so libGLESv1_CM.so.1
+ ln -sf libMali.so libGLESv1_CM.so.1.1
cd /tmp/$G_PROGRAM_NAME
- rm -R gpu_driver
+ # X.org packages and config
+ Download_Install 'https://dietpi.com/downloads/binaries/asus/xserver.7z' xserver
+ dpkg --force-hold,confdef,confold -i xserver/*.deb
+ G_BACKUP_FP /etc/X11/xorg.conf
dps_index=$software_id Download_Install 'xorg_asustb.conf' /etc/X11/xorg.conf
- rm $(ls /usr/lib/arm-linux-gnueabihf/libGLESv2.*)
- rm $(ls /usr/lib/arm-linux-gnueabihf/libEGL.*)
- mv /usr/lib/arm-linux-gnueabihf/libmali-midgard-r13p0-r0p0.so /usr/lib/arm-linux-gnueabihf/libMali.so
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libgbm.so.1
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libgbm.so.1.0.0
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libmali.so
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libMaliOpenCL.so
- ln -sf /usr/lib/arm-linux-gnueabihf/libMali.so /usr/lib/arm-linux-gnueabihf/libOpenCL.so
-
fi
fi
@@ -6691,12 +6307,11 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
# Stop OpenSSH service to unbind port 22
systemctl -q is-active ssh && systemctl stop ssh
- # On Stretch+ Dropbear packages have been split, install "dropbear-run" only, to have active service, but "skip dropbear-initramfs"
- if (( $G_DISTRO < 4 )); then
+ # On Stretch + Buster Dropbear packages have been split, install "dropbear-run" only, to have active service, but skip "dropbear-initramfs"
+ # On Bullseye+ "dropbear-run" has become a transitional dummy package for "dropbear" which does not include "dropbear-initramfs" anymore.
+ if (( $G_DISTRO > 5 )); then
G_AGI dropbear
- # ECDSA key is not generated (or converted from OpenSSH) automatically on Jessie
- [[ -f /etc/dropbear/dropbear_ecdsa_host_key ]] || dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
else
@@ -6802,27 +6417,13 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
Banner_Installing
- # On Jessie we need to our self-hosted packages:
- if (( $G_DISTRO < 4 )); then
-
- Download_Install "https://dietpi.com/downloads/binaries/jessie/openjdk-8-jre_$G_HW_ARCH_DESCRIPTION.7z"
- Download_Install "https://dietpi.com/downloads/binaries/jessie/openjdk-8-jdk_$G_HW_ARCH_DESCRIPTION.7z"
- dpkg --force-hold,confdef,confold -i ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb
- G_AGF
- rm ca-certificates-java.deb openjdk-8-jre-headless.deb openjdk-8-jdk-headless.deb
-
-
- else
-
- local version=8
- (( $G_DISTRO == 5 )) && version=11
-
- local packages="ca-certificates-java openjdk-$version-jre-headless openjdk-$version-jdk-headless"
- # Workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524
- apt-get install -y -qq $packages
- G_AGI $packages
+ local version=8
+ (( $G_DISTRO == 5 )) && version=11
- fi
+ local packages="ca-certificates-java openjdk-$version-jre-headless openjdk-$version-jdk-headless"
+ # Workaround for ARM install issue: https://github.com/MichaIng/DietPi/issues/2524
+ apt-get install -y -qq $packages
+ G_AGI $packages
fi
@@ -6864,63 +6465,29 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
fi
- software_id=140 # SDL2
- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
-
- Banner_Installing
-
- # X86_64
- if (( $G_HW_ARCH == 10 )); then
-
- # G_AGI libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 libsdl2-net-2.0-0 libsdl2-mixer-2.0-0
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-x86_64_stretch.7z'
-
- # ARMv6
- elif (( $G_HW_ARCH == 1 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv6_stretch.7z'
-
- # ARMv7 FKMS:
- # ./configure --disable-video-rpi --enable-video-kmsdrm
- elif (( $G_HW_ARCH == 2 )); then
-
- INSTALL_URL_ADDRESS='https://dietpi.com/downloads/binaries/all/sdl2-armv7_stretch.7z'
-
- # - RPi 2/3 Enable fkms OpenGL
- (( $G_HW_MODEL < 10 )) && /DietPi/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d
-
- fi
-
- Download_Install "$INSTALL_URL_ADDRESS" sdl2
- dpkg -i sdl2/*.deb
- rm -R sdl2
-
- fi
-
software_id=150 # Mono runtime
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
- Banner_Installing
+ Banner_Installing # https://www.mono-project.com/download/stable/#download-lin-debian
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
- # RPis + ARMv6 only available in Raspbian repo: https://github.com/MichaIng/DietPi/issues/1023
- if (( $G_HW_MODEL < 10 || $G_HW_ARCH == 1 )); then
+ # On RPi use separate Raspbian repo: https://github.com/MichaIng/DietPi/issues/1023
+ # Use Buster branch on Bullseye
+ if (( $G_HW_MODEL < 10 )); then
- echo "deb https://download.mono-project.com/repo/debian raspbian$G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list
+ echo "deb https://download.mono-project.com/repo/debian/ raspbian${G_DISTRO_NAME/bullseye/buster} main" > /etc/apt/sources.list.d/mono-xamarin.list
else
- echo "deb https://download.mono-project.com/repo/debian $G_DISTRO_NAME main" > /etc/apt/sources.list.d/mono-xamarin.list
+ echo "deb https://download.mono-project.com/repo/debian/ ${G_DISTRO_NAME/bullseye/buster} main" > /etc/apt/sources.list.d/mono-xamarin.list
fi
- # - Buster: Revert to Stretch, since Buster is not yet available
- sed -i 's/buster/stretch/g' /etc/apt/sources.list.d/mono-xamarin.list
G_AGUP
-
G_AGI mono-runtime mono-complete
- rm /tmp/mono* &> /dev/null # https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403856446
+
+ rm -f /tmp/mono* # https://github.com/MichaIng/DietPi/issues/1877#issuecomment-403856446
fi
@@ -6942,16 +6509,7 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
G_DIETPI-NOTIFY 2 "ha_python_version: $ha_python_version"
# Install needed libraries
- G_AGI cmake daemon gcc nmap net-tools swig uuid-dev libc-ares-dev libgnutls28-dev libgnutlsxx28 libglib2.0-dev libudev-dev libusb-1.0-0 libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev
- if (( $G_DISTRO < 4 )); then
-
- G_AGI libmysqlclient-dev
-
- else
-
- G_AGI libmariadbclient-dev
-
- fi
+ G_AGI cmake daemon gcc nmap net-tools swig uuid-dev libc-ares-dev libgnutls28-dev libgnutlsxx28 libglib2.0-dev libudev-dev libusb-1.0-0 libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev libmariadbclient-dev
# Setup the user account information
adduser --system $ha_user
@@ -6987,20 +6545,19 @@ Mycroft AI requires at least 2 GiB memory on first start. We will now increase y
fi
- software_id=170 # Unrar
+ software_id=170 # UnRAR
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then
Banner_Installing
- # Raspbian, only "unrar-free" available in repos
+ # On Raspbian, only "unrar-free" is available in repos, but does not support all rar formats, thus we use "unrar" [non-free] from Debian repo
if (( $G_HW_MODEL < 10 )); then
- #G_AGI unrar-free # Does not support all rar formats, better use "unrar-nonfree" from Debian repo
Download_Install "https://dietpi.com/downloads/binaries/rpi/unrar-armhf-$G_DISTRO_NAME.deb"
else
- G_AGI unrar # https://github.com/MichaIng/DietPi/issues/176#issuecomment-240101365
+ G_AGI unrar
fi
@@ -7289,9 +6846,9 @@ _EOF_
_EOF_
- # Use /var/www as default webfolder
- mv /var/www/html/index.html /var/www/index.html &> /dev/null
- [[ $(ls -A /var/www/html 2>&1) ]] || rm -R /var/www/html
+ # Use /var/www as default webroot
+ [[ -f '/var/www/html/index.html' ]] && mv /var/www/html/index.html /var/www/
+ rmdir --ignore-fail-on-non-empty /var/www/html
# Change error log level
sed -i '/LogLevel[[:blank:]]/c\ LogLevel error' /etc/apache2/sites-available/*
@@ -7318,7 +6875,7 @@ _EOF_
dps_index=$software_id Download_Install 'nginx.default' /etc/nginx/sites-available/default
# Nginx index page
- cp /usr/share/nginx/html/index.html /var/www/index.html
+ [[ -f '/var/www/html/index.nginx-debian.html' ]] && mv /var/www/html/index.nginx-debian.html /var/www/
rmdir --ignore-fail-on-non-empty /var/www/html
fi
@@ -7328,9 +6885,11 @@ _EOF_
Banner_Configuration
- # www path
- G_BACKUP_FP /etc/lighttpd/lighttpd.conf
+ # Webroot
sed -i '/^server.document-root/c\server.document-root = "/var/www"' /etc/lighttpd/lighttpd.conf
+ # - Move default page
+ [[ -f '/var/www/html/index.lighttpd.html' ]] && mv /var/www/html/index.lighttpd.html /var/www/
+ rmdir --ignore-fail-on-non-empty /var/www/html
# Fix in case Lighttpd got updated to Buster version (on ARMv6 due to PHP7.3 libssl1.1 depedency)
# - "create-mime.assign.pl" has been renamed to "create-mime.conf.pl"
@@ -7350,15 +6909,10 @@ fastcgi.server += ( ".php" =>
))
)
_EOF_
-
- # Enable cgi/php
+ # - Enable modules
lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php
- # Move default page
- mv /var/www/html/index.lighttpd.html /var/www/
- rmdir --ignore-fail-on-non-empty /var/www/html
-
fi
software_id=89 # PHP
@@ -7469,18 +7023,25 @@ _EOF_
Banner_Configuration
- # On Jessie assure unix_socket authentication:
- if (( $G_DISTRO < 4 )); then
+ G_DIETPI-NOTIFY 2 'Assuring 4-byte support and InnoDB Barracuda file format with large prefix'
+ 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
+character-set-server=utf8mb4
+collation-server=utf8mb4_general_ci
+_EOF_
+ # Since Buster (MariaDB 10.3) the following settings are removed and default to our needs:
+ # - innodb_large_prefix: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_large_prefix
+ # - innodb_file_format: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_file_format
+ if (( $G_DISTRO > 4 )); then
- G_RUN_CMD systemctl start $MARIADB_SERVICE
- 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 -e "drop user 'root'@'dietpi';drop user 'root'@'127.0.0.1';drop user 'root'@'::1'" &> /dev/null
+ sed -i '/innodb_large_prefix/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf
+ sed -i '/innodb_file_format/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf
fi
- ### Also for MariaDB?
# Optimise for reduced memory use: https://github.com/MichaIng/DietPi/issues/605#issue-188930987
#cat << _EOF_ > /etc/mysql/mariadb.conf.d/99-dietpi.cnf
#[mysqld]
@@ -7509,7 +7070,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:
# https://dietpi.com/phpbb/viewtopic.php?p=54#p54
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysql -e 'grant all privileges on *.* to phpmyadmin@localhost with grant option'
fi
@@ -7541,7 +7102,7 @@ _EOF_
G_CONFIG_INJECT '"Gateway": "' " \"Gateway\": \"/ip4/$(sed -n 4p /DietPi/dietpi/.network)/tcp/4002\"," $G_FP_DIETPI_USERDATA/openbazaar/config
# - Client connection user/password
- G_DIETPI-NOTIFY 2 "Please enter username and password for your ${aSOFTWARE_WHIP_NAME[$software_id]} client connection:"
+ G_DIETPI-NOTIFY 2 "Please enter username and password for your ${aSOFTWARE_NAME[$software_id]} client connection:"
openbazaar-go setapicreds -d $G_FP_DIETPI_USERDATA/openbazaar
# - Client IP needs to be added to allowed IP list
@@ -7550,8 +7111,8 @@ _EOF_
while :
do
- G_WHIP_INPUTBOX "${invalid_entry}Please enter the IP address of your ${aSOFTWARE_WHIP_NAME[$software_id]} client machine
-This is required, since the ${aSOFTWARE_WHIP_NAME[$software_id]} server node by default does not allow any remote connection."
+ G_WHIP_INPUTBOX "${invalid_entry}Please enter the IP address of your ${aSOFTWARE_NAME[$software_id]} client machine
+This is required, since the ${aSOFTWARE_NAME[$software_id]} server node by default does not allow any remote connection."
if (( ! $? )) && [[ $G_WHIP_RETURNED_VALUE =~ ^[0-9.]+$ ]]; then
ob_client_ip=$G_WHIP_RETURNED_VALUE
@@ -7568,7 +7129,7 @@ This is required, since the ${aSOFTWARE_WHIP_NAME[$software_id]} server node by
else
- G_DIETPI-NOTIFY 2 "Existing ${aSOFTWARE_WHIP_NAME[$software_id]} config found. Skipping pre-configuration..."
+ G_DIETPI-NOTIFY 2 "Existing ${aSOFTWARE_NAME[$software_id]} config found. Skipping pre-configuration..."
fi
@@ -7619,9 +7180,10 @@ _EOF_
Banner_Configuration
# Remove old data + config directories and init.d service
- rm -R /var/lib/fahclient
- rm -R /etc/fahclient
- rm /etc/init.d/FAHClient
+ [[ -d '/var/lib/fahclient' ]] && rm -R /var/lib/fahclient
+ [[ -d '/etc/fahclient' ]] && rm -R /etc/fahclient
+ [[ -f '/etc/init.d/FAHClient' ]] && rm /etc/init.d/FAHClient
+ update-rc.d -f FAHClient remove
# Create new working (data + config) directory and log file
mkdir -p $G_FP_DIETPI_USERDATA/fahclient
@@ -7642,6 +7204,9 @@ ExecStart=$(command -v FAHClient) --allow='0/0' --web-allow='0/0' --daemon=false
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log
+
fi
software_id=47 # ownCloud
@@ -7650,9 +7215,7 @@ _EOF_
Banner_Configuration
G_DIETPI-NOTIFY 2 'Enabling needed PHP modules.' # https://doc.owncloud.org/server/administration_manual/installation/manual_installation.html#php-extensions
- phpenmod curl gd intl json pdo_mysql opcache apcu redis
- # Following modules are switchable since Stretch:
- (( $G_DISTRO > 3 )) && phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif
+ phpenmod curl gd intl json pdo_mysql opcache apcu redis ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif
G_DIETPI-NOTIFY 2 'Enabling APCu memory cache for PHP command line usage (CLI) as well, including ownCloud occ command and cron jobs.'
echo -e '; ownCloud PHP settngs\n; priority=99\napc.enable_cli=1' > $FP_PHP_BASE_DIR/mods-available/dietpi-owncloud.ini
@@ -7688,19 +7251,11 @@ Redirect permanent /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/
# Enable required modules
G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
G_CONFIG_INJECT '"mod_setenv",' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
- if (( $G_DISTRO < 4 )); then
-
- G_CONFIG_INJECT '"mod_rewrite",' ' "mod_rewrite",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
-
- else
-
- lighttpd-enable-mod rewrite
-
- fi
+ lighttpd-enable-mod rewrite
# Move ownCloud configuration file in place and activate it
owncloud_conf='/etc/lighttpd/conf-available/99-dietpi-owncloud.conf'
- if [[ -f $owncloud ]]; then
+ if [[ -f $owncloud_conf ]]; then
owncloud_conf+='.dietpi-new'
G_WHIP_MSG "Existing ownCloud Lighttpd configuration found, will preserve the old one and save the new one for review and comparison to: $nextcloud_conf"
@@ -7734,9 +7289,6 @@ url.redirect += (
dps_index=$software_id Download_Install 'nginx.owncloud.conf' $owncloud_conf
- # Stretch: Set 'fastcgi_request_buffering off';
- (( $G_DISTRO > 3 )) && sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $owncloud_conf
-
# Uncomment HSTS header, if chosen via dietpi-letsencrypt and HTTPS connection test succeeds (incl. self-singed cert => exit code 5)
if [[ -f /DietPi/dietpi/.dietpi-letsencrypt && $(sed -n 4p /DietPi/dietpi/.dietpi-letsencrypt) == 1 ]]; then
@@ -7767,30 +7319,8 @@ location = /.well-known/caldav {
fi
- G_DIETPI-NOTIFY 2 'Enable 4-byte support for MariaDB.' # https://doc.owncloud.org/server/administration_manual/configuration/database/linux_database_configuration.html#configure-mysql-for-4-byte-unicode-support
- local fp_mariadb_conf='/etc/mysql/mariadb.conf.d'
- # On Jessie (MariaDB 10.0), /etc/mysql/mariadb.conf.d does not yet exist
- (( $G_DISTRO < 4 )) && fp_mariadb_conf='/etc/mysql/conf.d'
- cat << _EOF_ > $fp_mariadb_conf/99-dietpi-4byte.cnf
-[mysqld]
-innodb_large_prefix=1
-innodb_file_format=barracuda
-innodb_file_per_table=1
-character-set-server=utf8mb4
-collation-server=utf8mb4_general_ci
-_EOF_
- # On Buster (MariaDB 10.3) the following settings are removed and default to our needs:
- # - innodb_large_prefix: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_large_prefix
- # - innodb_file_format: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_file_format
- if (( $G_DISTRO > 4 )); then
-
- sed -i '/innodb_large_prefix/d' $fp_mariadb_conf/99-dietpi-4byte.cnf
- sed -i '/innodb_file_format/d' $fp_mariadb_conf/99-dietpi-4byte.cnf
-
- fi
- G_RUN_CMD systemctl restart $MARIADB_SERVICE
-
- # Start redis-server, which is required for ncc command:
+ # Start MariaDB and Redis for database creation and occ command
+ G_RUN_CMD systemctl restart mariadb
G_RUN_CMD systemctl start redis-server
# Initially add occ command shortcut, will be done by Dietpi-Globals automatically, if occ file exist:
@@ -7915,9 +7445,7 @@ _EOF_
Banner_Configuration
G_DIETPI-NOTIFY 2 'Enabling required PHP modules.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
- phpenmod curl gd intl json pdo_mysql opcache apcu redis
- # Following modules are switchable since Stretch:
- (( $G_DISTRO > 3 )) && phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif
+ phpenmod curl gd intl json pdo_mysql opcache apcu redis ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif
G_DIETPI-NOTIFY 2 'Optimising APCu and OPcache modules for Nextcloud.' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
echo -e '; Nextcloud PHP settngs\n; priority=99\napc.enable_cli=1\nopcache.enable=1\nopcache.interned_strings_buffer=8
@@ -7954,15 +7482,7 @@ Redirect permanent /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2
# Enable required modules
G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
G_CONFIG_INJECT '"mod_setenv",' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
- if (( $G_DISTRO < 4 )); then
-
- G_CONFIG_INJECT '"mod_rewrite",' ' "mod_rewrite",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
-
- else
-
- lighttpd-enable-mod rewrite
-
- fi
+ lighttpd-enable-mod rewrite
# Move Nextcloud configuration file in place and activate it
nextcloud_conf='/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf'
@@ -7999,9 +7519,6 @@ url.redirect += (
fi
dps_index=$software_id Download_Install 'nginx.nextcloud.conf' $nextcloud_conf
- # Stretch: Set 'fastcgi_request_buffering off';
- (( $G_DISTRO > 3 )) && sed -i 's/#fastcgi_request_buffering off;/fastcgi_request_buffering off;/g' $nextcloud_conf
-
# Uncomment HSTS header, if chosen via dietpi-letsencrypt and HTTPS connection test succeeds (incl. self-singed cert => exit code 5)
if [[ -f /DietPi/dietpi/.dietpi-letsencrypt && $(sed -n 4p /DietPi/dietpi/.dietpi-letsencrypt) == 1 ]]; then
@@ -8032,30 +7549,8 @@ location = /.well-known/caldav {
fi
- G_DIETPI-NOTIFY 2 'Enable 4-byte support for MariaDB' # https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/mysql_4byte_support.html
- local fp_mariadb_conf='/etc/mysql/mariadb.conf.d'
- # On Jessie (MariaDB 10.0), /etc/mysql/mariadb.conf.d does not yet exist
- (( $G_DISTRO < 4 )) && fp_mariadb_conf='/etc/mysql/conf.d'
- cat << _EOF_ > $fp_mariadb_conf/99-dietpi-4byte.cnf
-[mysqld]
-innodb_large_prefix=1
-innodb_file_format=barracuda
-innodb_file_per_table=1
-character-set-server=utf8mb4
-collation-server=utf8mb4_general_ci
-_EOF_
- # On Buster (MariaDB 10.3) the following settings are removed and default to our needs:
- # - innodb_large_prefix: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_large_prefix
- # - innodb_file_format: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_file_format
- if (( $G_DISTRO > 4 )); then
-
- sed -i '/innodb_large_prefix/d' $fp_mariadb_conf/99-dietpi-4byte.cnf
- sed -i '/innodb_file_format/d' $fp_mariadb_conf/99-dietpi-4byte.cnf
-
- fi
- G_RUN_CMD systemctl restart $MARIADB_SERVICE
-
- # Start redis-server, which is required for ncc command:
+ # Start MariaDB and Redis for database creation and ncc command
+ G_RUN_CMD systemctl restart mariadb
G_RUN_CMD systemctl start redis-server
# Initially add occ command shortcut, will be done by Dietpi-Globals automatically, if occ file exist:
@@ -8082,7 +7577,7 @@ To remove the existing database (including e.g. contacts, calendar, file tags et
# mysqladmin drop nextcloud
Otherwise to copy an existing instance in place:
# rm -R /var/www/nextcloud
- # cp -a /path/to/existing/nextcloud/. /var/www/nextcloud
+ # cp -a /path/to/existing/nextcloud/. /var/www/nextcloud/
# chown -R www-data:www-data /var/www/nextcloud\n
The install script will now exit. After applying one of the the above, rerun dietpi-software, e.g.:
# dietpi-software install 114'
@@ -8124,11 +7619,11 @@ The install script will now exit. After applying one of the the above, rerun die
fi
# Workaround Nextcloud 14.0.3 throwing an error, when data dir path contains a symlink: https://github.com/nextcloud/server/issues/12247
- if (( $G_DISTRO > 3 )) && [[ $(readlink -f $datadir) != $datadir ]]; then
+ if [[ $(readlink -f $datadir) != $datadir ]]; then
G_ERROR_HANDLER_RESET
# Install with this error does not copy over skeleton
- cp -a /var/www/nextcloud/core/skeleton/. "$datadir/$username/files"
+ cp -a /var/www/nextcloud/core/skeleton/. "$datadir/$username/files/"
else
@@ -8212,18 +7707,19 @@ The install script will now exit. After applying one of the the above, rerun die
Banner_Configuration
G_DIETPI-NOTIFY 2 'Configuring TURN server:'
- # Buster (systemd unit)
+ # Buster: systemd unit
if [[ -f '/lib/systemd/system/coturn.service' ]]; then
- # - Remove init.d service traces
+ # - Remove sysvinit service traces
[[ -f '/etc/init.d/coturn' ]] && rm /etc/init.d/coturn
+ update-rc.d -f coturn remove
[[ -f '/etc/default/coturn' ]] && rm /etc/default/coturn
# - Disable coturn logging by default, this can be overridden via /etc/turnserver.conf
mkdir -p /etc/systemd/system/coturn.service.d
echo -e "[Service]\nExecStart=\n$(grep -m1 "^[[:blank:]]*ExecStart=" /lib/systemd/system/coturn.service) -l stdout --no-stdout-log --simple-log" > /etc/systemd/system/coturn.service.d/dietpi-logging.conf
- # Stretch/Jessie (init.d service)
+ # Stretch: sysvinit service
else
# - Enable init.d service
@@ -8313,7 +7809,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal
fi
# Install Nextcloud Talk app
- G_RUN_CMD systemctl start $MARIADB_SERVICE
+ G_RUN_CMD systemctl start mariadb
G_RUN_CMD systemctl start redis-server
G_RUN_CMD ncc maintenance:mode --off
[[ -d '/var/www/nextcloud/apps/spreed' ]] || G_RUN_CMD ncc app:install spreed
@@ -8337,8 +7833,9 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal
Banner_Configuration
- # Remove obsolete init.d service and its environment file
+ # Remove obsolete sysvinit service and its environment file
[[ -f '/etc/init.d/transmission-daemon' ]] && rm /etc/init.d/transmission-daemon
+ update-rc.d -f transmission-daemon remove
[[ -f '/etc/default/transmission-daemon' ]] && rm /etc/default/transmission-daemon
# Run service as "dietpi" group: https://github.com/MichaIng/DietPi/issues/350#issuecomment-423763518
@@ -8388,7 +7885,7 @@ NB: This port needs to be forwarded by your router and/or opened in your firewal
Banner_Configuration
# Create MPD user
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd mpd &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi,audio -d $G_FP_DIETPI_USERDATA/.mpd_cache -s $(command -v nologin) mpd
# - Add to new "render" group on Buster
@@ -8469,16 +7966,6 @@ WantedBy=multi-user.target
Also=mpd.socket
_EOF_
- # - Jessie: Remove unsupported systemd unit settings
- if (( $G_DISTRO < 4 )); then
-
- sed -i '/ProtectKernelTunables/d' /lib/systemd/system/mpd.service
- sed -i '/ProtectControlGroups/d' /lib/systemd/system/mpd.service
- sed -i '/ProtectKernelModules/d' /lib/systemd/system/mpd.service
- sed -i '/RestrictNamespaces/d' /lib/systemd/system/mpd.service
-
- fi
-
# JustBoom specials
if grep -qi '^[[:blank:]]*CONFIG_SOUNDCARD=justboom' /DietPi/dietpi.txt; then
@@ -8502,6 +7989,11 @@ _EOF_
# Grab our test music for the user.
Download_Test_Media
+ # Permissions
+ chmod 0664 /var/log/mpd/mpd.log /etc/mpd.conf
+ chmod -R 775 $G_FP_DIETPI_USERDATA/.mpd_cache
+ chown -R mpd:dietpi /etc/mpd.conf /var/log/mpd $G_FP_DIETPI_USERDATA/.mpd_cache
+
fi
software_id=94 # ProFTPD
@@ -8562,7 +8054,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd ympd &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi,audio -s $(command -v nologin) ympd
# - Add to new "render" group on Buster
@@ -8591,28 +8083,16 @@ _EOF_
Banner_Configuration
# Add user to "dietpi" group
- usermod -a -G dietpi mympd
- # - Add to new "render" group on Buster
- (( $G_DISTRO > 4 )) && usermod -a -G render mympd
-
- # Run service as "dietpi" group
- mkdir -p /etc/systemd/systemd/mympd.service.d
- echo -e '[Service]\nGroup=dietpi' > /etc/systemd/systemd/mympd.service.d/dietpi-group.conf
+ usermod -aG dietpi mympd
+ # Add to new "render" group on Buster
+ (( $G_DISTRO > 4 )) && usermod -aG render mympd
# Adjust config file on fresh install
# - On reinstall /etc/mympd/mympd.conf.dist will be created, so use its existence as reinstall flag
- if [[ ! -f '/etc/mympd/mympd.conf.dist' ]]; then
-
- G_CONFIG_INJECT 'webport[[:blank:]]*=' 'webport = 1333' /etc/mympd/mympd.conf
- G_CONFIG_INJECT 'ssl[[:blank:]]*=' 'ssl = false' /etc/mympd/mympd.conf
+ if [[ ! -f '/etc/mympd.conf.dist' ]]; then
- fi
-
- # Symlink music/libary dir to DietPi music dir
- if [[ $(readlink /usr/share/mympd/htdocs/library) != $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC ]]; then
-
- rm -Rf /usr/share/mympd/htdocs/library
- ln -sf $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC /usr/share/mympd/htdocs/library
+ G_CONFIG_INJECT 'webport[[:blank:]]*=' 'webport = 1333' /etc/mympd.conf
+ G_CONFIG_INJECT 'ssl[[:blank:]]*=' 'ssl = false' /etc/mympd.conf
fi
@@ -8623,24 +8103,20 @@ _EOF_
Banner_Configuration
- #useradd -rM roon -G dietpi,audio,render -s $(command -v nologin)
- #root required for remote updates
-
- mkdir -p $G_FP_DIETPI_USERDATA/roon
+ #useradd -rMU -G dietpi,audio,render -d $G_FP_DIETPI_USERDATA/roon -s $(command -v nologin) roon
+ # root required for remote updates
dps_index=$software_id Download_Install 'roonbridge.service' /etc/systemd/system/roonbridge.service
- # - Move logfiles to /var/log/ (dietpi-ramlog)
- # Remove any previous folders to clear for symlink
- [[ -d $G_FP_DIETPI_USERDATA/roon/RoonBridge/Logs ]] && rm -R $G_FP_DIETPI_USERDATA/roon/RoonBridge/Logs
- [[ -d $G_FP_DIETPI_USERDATA/roon/RAATServer/Logs ]] && rm -R $G_FP_DIETPI_USERDATA/roon/RAATServer/Logs
+ # Move logfiles to /var/log (dietpi-ramlog)
+ mkdir -p /var/log/roon $G_FP_DIETPI_USERDATA/roon/{RoonBridge,RAATServer}
+ # - Clear symlink locations
+ rm -Rf $G_FP_DIETPI_USERDATA/roon/{RoonBridge,RAATServer}/Logs
+ ln -s /var/log/roon $G_FP_DIETPI_USERDATA/roon/RoonBridge/Logs
+ ln -s /var/log/roon $G_FP_DIETPI_USERDATA/roon/RAATServer/Logs
- mkdir -p $G_FP_DIETPI_USERDATA/roon/RoonBridge
- mkdir -p $G_FP_DIETPI_USERDATA/roon/RAATServer
- mkdir -p /var/log/roon
-
- ln -sf /var/log/roon $G_FP_DIETPI_USERDATA/roon/RoonBridge/Logs
- ln -sf /var/log/roon $G_FP_DIETPI_USERDATA/roon/RAATServer/Logs
+ # Permissions
+ chown -R roon:dietpi $G_FP_DIETPI_USERDATA/roon /var/log/roon
fi
@@ -8649,13 +8125,21 @@ _EOF_
Banner_Configuration
- usercmd='useradd -r'
- getent passwd nodered &> /dev/null && usercmd='usermod -a'
- $usercmd -G gpio -d $G_FP_DIETPI_USERDATA/node-red -s $(command -v nologin) nodered
+ # Data dir
+ mkdir -p $G_FP_DIETPI_USERDATA/node-red
+
+ # User
+ local usercmd='useradd -rMU'
+ getent passwd nodered &> /dev/null && usercmd='usermod'
+ $usercmd -d $G_FP_DIETPI_USERDATA/node-red -s $(command -v nologin) nodered
+
+ # - Only add user to "gpio" group, if it does exist (most SBCs), otherwise user creation fails: https://github.com/MichaIng/DietPi/issues/2975#issuecomment-513917360
+ getent group gpio &> /dev/null && usermod -aG gpio nodered
- # Allow sudo calls
+ # - Allow sudo calls
echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered
+ # Service
cat << _EOF_ > /etc/systemd/system/node-red.service
[Unit]
Description=Node-RED (DietPi)
@@ -8668,6 +8152,9 @@ ExecStart=$(command -v node-red) -u $G_FP_DIETPI_USERDATA/node-red
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R nodered:nodered $G_FP_DIETPI_USERDATA/node-red
+
fi
software_id=125 # Tomcat8
@@ -8725,22 +8212,24 @@ _EOF_
G_CONFIG_INJECT 'data_dir[[:blank:]]*=' 'data_dir = /mnt/dietpi_userdata/mopidy/data' /etc/mopidy/mopidy.conf '\[core\]'
G_CONFIG_INJECT 'cache_dir[[:blank:]]*=' 'cache_dir = /mnt/dietpi_userdata/mopidy/cache' /etc/mopidy/mopidy.conf '\[core\]'
- # - Move existing home+data to dietpi_userdata, if not yet existent
+ # Move existing home+data to dietpi_userdata, if not yet existent
if [[ -d '/var/lib/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy ]]; then
mv /var/lib/mopidy $G_FP_DIETPI_USERDATA/mopidy
- mkdir -p $G_FP_DIETPI_USERDATA/mopidy/data
- # - Non-hidden files/folders are data
- mv $G_FP_DIETPI_USERDATA/mopidy/* $G_FP_DIETPI_USERDATA/mopidy/data
+ # Workaround error about moving data dir into itself
+ mkdir -p $G_FP_DIETPI_USERDATA/mopidy/.hidden_data
+ # Non-hidden files/folders are data
+ mv $G_FP_DIETPI_USERDATA/mopidy/* $G_FP_DIETPI_USERDATA/mopidy/.hidden_data
+ mv $G_FP_DIETPI_USERDATA/mopidy/.hidden_data $G_FP_DIETPI_USERDATA/mopidy/data
else
mkdir -p $G_FP_DIETPI_USERDATA/mopidy/data
- [[ -d /var/lib/mopidy ]] && rm -R /var/lib/mopidy
+ [[ -d '/var/lib/mopidy' ]] && rm -R /var/lib/mopidy
fi
- # - Move existing cache to dietpi_userdata, if not yet existent
+ # Move existing cache to dietpi_userdata, if not yet existent
if [[ -d '/var/cache/mopidy' && ! -d $G_FP_DIETPI_USERDATA/mopidy/cache ]]; then
mv /var/cache/mopidy $G_FP_DIETPI_USERDATA/mopidy/cache
@@ -8748,16 +8237,19 @@ _EOF_
else
mkdir -p $G_FP_DIETPI_USERDATA/mopidy/cache
- [[ -d /var/cache/mopidy ]] && rm -R /var/cache/mopidy
+ [[ -d '/var/cache/mopidy' ]] && rm -R /var/cache/mopidy
fi
- # - Adjust user group and home dir
- usermod -a -G dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy
+ # Permissions
+ chown -R mopidy:root $G_FP_DIETPI_USERDATA/mopidy
+
+ # Adjust user group and home dir
+ usermod -aG dietpi,audio -d $G_FP_DIETPI_USERDATA/mopidy mopidy
# - Add to new "render" group on Buster
- (( $G_DISTRO > 4 )) && usermod -a -G render mopidy
+ (( $G_DISTRO > 4 )) && usermod -aG render mopidy
- # - Adjust systemd unit to match new group and do not pre-create obsolete cache dir
+ # Adjust systemd unit to match new group and do not pre-create obsolete cache dir
mkdir -p /etc/systemd/system/mopidy.service.d
echo -e '[Service]\nGroup=dietpi\nExecStartPre=' > /etc/systemd/system/mopidy.service.d/dietpi.conf
@@ -8771,18 +8263,16 @@ _EOF_
Banner_Configuration
# Remove Kodi user (Whilst waving)
- userdel -r kodi &> /dev/null
+ getent passwd kodi &> /dev/null && userdel -r kodi
# Run Kodi as root
[[ -f '/etc/default/kodi' ]] && G_CONFIG_INJECT 'USER=' 'USER=root' /etc/default/kodi
# Copy udev rules, probably not needed for root, but we'll do it anyway
dps_index=$software_id Download_Install '99-dietpi-kodi.rules' /etc/udev/rules.d/99-dietpi-kodi.rules
- chmod +x /etc/udev/rules.d/99-dietpi-kodi.rules
- # Create .desktop SymLinks
+ # Create .desktop symlink
mkdir -p /root/Desktop
- [[ -f '/usr/share/applications/kodi.desktop' ]] && rm /usr/share/applications/kodi.desktop
G_RUN_CMD wget https://raw.githubusercontent.com/MichaIng/DietPi/$G_GITBRANCH/.conf/desktop/apps/kodi.desktop -O /usr/share/applications/kodi.desktop
ln -sf /usr/share/applications/kodi.desktop /root/Desktop/kodi.desktop
@@ -8793,11 +8283,12 @@ _EOF_
Banner_Configuration
- userdel -rf minidlna &> /dev/null
- useradd -rM minidlna -G dietpi -s $(command -v nologin)
+ local usercmd='useradd -rMU'
+ getent passwd minidlna &> /dev/null && usercmd='usermod -a'
+ $usercmd -G dietpi -s $(command -v nologin) minidlna
[[ -f '/etc/init.d/minidlna' ]] && rm /etc/init.d/minidlna
- [[ -f '/etc/systemd/system/minidlna.service' ]] && rm /etc/systemd/system/minidlna.service
+ update-rc.d -f minidlna remove
[[ -f '/lib/systemd/system/minidlna.service' ]] && rm /lib/systemd/system/minidlna.service
cat << _EOF_ > /etc/systemd/system/minidlna.service
@@ -8815,12 +8306,13 @@ ExecStart=$(command -v minidlnad) -SR -f /etc/minidlna.conf
WantedBy=multi-user.target
_EOF_
- # Copy Config
+ # Copy config
G_BACKUP_FP /etc/minidlna.conf
dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf
- # Setup data directories
+ # Data dir
mkdir -p $G_FP_DIETPI_USERDATA/.MiniDLNA_Cache
+ chown -R minidlna:dietpi $G_FP_DIETPI_USERDATA/.MiniDLNA_Cache
Download_Test_Media
@@ -8858,76 +8350,72 @@ _EOF_
Banner_Configuration
- # Allow binary execution
- chmod -R +x $G_FP_DIETPI_USERDATA/amiberry
-
- local amiberry_filename=0
+ local amiberry_filename
local capsimg_filename='capsimg-rpi.so'
- # - ASUS TB
+ # ASUS TB
if (( $G_HW_MODEL == 52 )); then
amiberry_filename='amiberry-tinker'
capsimg_filename='capsimg-tinker.so'
- # - XU4
+ # XU4
elif (( $G_HW_MODEL == 11 )); then
amiberry_filename='amiberry-xu4'
capsimg_filename='capsimg-xu4.so'
- # - RPi 4
+ # RPi4
elif (( $G_HW_MODEL == 4 )); then
- :
+ amiberry_filename='amiberry-rpi4-sdl2-dispmanx'
- # - RPi 3
+ # RPi3
elif (( $G_HW_MODEL == 3 )); then
amiberry_filename='amiberry-rpi3-sdl2-dispmanx'
- # - RPi 2
+ # RPi2
elif (( $G_HW_MODEL == 2 )); then
amiberry_filename='amiberry-rpi2-sdl2-dispmanx'
- # - Assume RPi 1 (ARMv6)
+ # Assume RPi1 (ARMv6)
else
amiberry_filename='amiberry-rpi1-sdl2-dispmanx'
fi
- # - Update capsimg.so
- rm $G_FP_DIETPI_USERDATA/amiberry/capsimg.so &> /dev/null
- mv $G_FP_DIETPI_USERDATA/amiberry/"$capsimg_filename" $G_FP_DIETPI_USERDATA/amiberry/capsimg.so
+ # Update executable and capsimg.so
+ mv "$G_FP_DIETPI_USERDATA/amiberry/$amiberry_filename" $G_FP_DIETPI_USERDATA/amiberry/amiberry
+ mv "$G_FP_DIETPI_USERDATA/amiberry/$capsimg_filename" $G_FP_DIETPI_USERDATA/amiberry/capsimg.so
+ rm $G_FP_DIETPI_USERDATA/amiberry/{amiberry,capsimg}-*
+
+ # Create additional user media directories
+ mkdir -p $G_FP_DIETPI_USERDATA/amiberry/{floppy_images,hdf,cd}
- # - Create additional user media directories
- mkdir -p $G_FP_DIETPI_USERDATA/amiberry/floppy_images
- mkdir -p $G_FP_DIETPI_USERDATA/amiberry/hdf
- mkdir -p $G_FP_DIETPI_USERDATA/amiberry/cd
+ # Remove obsolete and old config file to allow Amiberry recreating it: https://github.com/midwan/amiberry/releases/tag/v2.25
+ [[ -f $G_FP_DIETPI_USERDATA/amiberry/conf/adfdir.conf ]] && rm $G_FP_DIETPI_USERDATA/amiberry/conf/adfdir.conf
+ [[ -f $G_FP_DIETPI_USERDATA/amiberry/conf/amiberry.conf ]] && rm $G_FP_DIETPI_USERDATA/amiberry/conf/amiberry.conf
- # Uae4arm does not support browsing symlinks (https://github.com/MichaIng/DietPi/issues/474#issuecomment-242973839)
- # So we need to change config file default paths to actual userdata location:
- local fp_userdata_actual=$(readlink $G_FP_DIETPI_USERDATA) # Only returns a value if symlink exists (eg: off SDcard)
- if [[ $fp_userdata_actual ]]; then
+ # Uae4arm does not support browsing symlinks: https://github.com/MichaIng/DietPi/issues/474#issuecomment-242973839
+ # - So we need to change config file default paths to actual userdata location
+ if [[ -L $G_FP_DIETPI_USERDATA ]]; then
- sed -i "s:$G_FP_DIETPI_USERDATA:$fp_userdata_actual:g" $G_FP_DIETPI_USERDATA/amiberry/conf/adfdir.conf
+ local fp_userdata_actual=$(readlink -f $G_FP_DIETPI_USERDATA)
sed -i "s:$G_FP_DIETPI_USERDATA:$fp_userdata_actual:g" $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae
fi
- # - Service
- local exec_start="$G_FP_DIETPI_USERDATA/amiberry/$amiberry_filename -f $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae"
- if (( $G_HW_MODEL == 52 )); then
-
- exec_start="$(command -v xinit) $G_FP_DIETPI_USERDATA/amiberry/$amiberry_filename -f $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae"
-
- fi
+ # Service
+ # - On Stretch Asus TB we need to start it as X11 session
+ local xinit_start=''
+ (( $G_HW_MODEL == 52 && $G_DISTRO < 5 )) && xinit_start="$(command -v xinit) "
cat << _EOF_ > /etc/systemd/system/amiberry.service
[Unit]
-Description=AmiBerry Amiga Emulator (DietPi)
+Description=Amiberry Amiga Emulator (DietPi)
[Service]
#StandardOutput=tty
@@ -8936,19 +8424,21 @@ Description=AmiBerry Amiga Emulator (DietPi)
#TTYReset=yes
#TTYVHangup=yes
WorkingDirectory=$G_FP_DIETPI_USERDATA/amiberry
-ExecStart=$exec_start
+ExecStart=$xinit_start$G_FP_DIETPI_USERDATA/amiberry/amiberry -f $G_FP_DIETPI_USERDATA/amiberry/conf/autostart.uae
[Install]
WantedBy=local-fs.target
_EOF_
+ # Start script
cat << _EOF_ > $G_FP_DIETPI_USERDATA/amiberry/run.sh
#!/bin/dash
cd $G_FP_DIETPI_USERDATA/amiberry
-./$amiberry_filename -f conf/autostart.uae
+./amiberry -f conf/autostart.uae
_EOF_
- chmod +x $G_FP_DIETPI_USERDATA/amiberry/run.sh
+ # Execute permissions
+ chmod +x $G_FP_DIETPI_USERDATA/amiberry/{amiberry,run.sh}
fi
@@ -9036,6 +8526,7 @@ _EOF_
mkdir -p $G_FP_DIETPI_USERDATA/rpicam
rm -R /var/www/rpicam/media
ln -s $G_FP_DIETPI_USERDATA/rpicam /var/www/rpicam/media
+ chown -R www-data:www-data $G_FP_DIETPI_USERDATA/rpicam
# - Enable RPi camera
/DietPi/dietpi/func/dietpi-set_hardware rpi-camera enable
@@ -9047,14 +8538,11 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd debian-deluged &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/deluge -s $(command -v nologin) debian-deluged
- mkdir -p $G_FP_DIETPI_USERDATA/deluge/.config/deluge
- chown -R debian-deluged:debian-deluged $G_FP_DIETPI_USERDATA/deluge
- mkdir -p /var/log/deluged
- chown -R debian-deluged /var/log/deluged
+ mkdir -p $G_FP_DIETPI_USERDATA/deluge/.config/deluge /var/log/deluged
# https://git.deluge-torrent.org/deluge/tree/packaging/systemd/deluged.service
cat << _EOF_ > /etc/systemd/system/deluged.service
@@ -9118,11 +8606,16 @@ _EOF_
fi
- # Remove init.d service leftovers, installed by Debian APT package
+ # Remove sysvinit service leftovers, installed by Debian APT package
[[ -f '/etc/init.d/deluged' ]] && rm /etc/init.d/deluged
+ update-rc.d -f deluged remove
[[ -f '/etc/default/deluged' ]] && rm /etc/default/deluged
[[ -d '/var/lib/deluged' ]] && rm -R /var/lib/deluged
+ # Permissions
+ chown -R debian-deluged:debian-deluged $G_FP_DIETPI_USERDATA/deluge
+ chown -R debian-deluged /var/log/deluged
+
fi
software_id=115 # Webmin
@@ -9130,8 +8623,8 @@ _EOF_
Banner_Configuration
- update-rc.d webmin remove &> /dev/null
- rm /etc/init.d/webmin &> /dev/null
+ [[ -f '/etc/init.d/webmin' ]] && rm /etc/init.d/webmin
+ update-rc.d -f webmin remove
cat << _EOF_ > /etc/systemd/system/webmin.service
[Unit]
Description=Webmin (DietPi)
@@ -9152,15 +8645,68 @@ _EOF_
Banner_Configuration
- # - Create symlinks to align Pi-hole admin and blocking page relative to webroot
+ # Webserver configs
+ # - Lighttpd
+ if (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then
+
+ # Enable required modules
+ G_CONFIG_INJECT '"mod_setenv",' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
+
+ # Add and enable Pi-hole config
+ dps_index=$software_id Download_Install 'lighttpd.pihole.conf' /etc/lighttpd/conf-available/99-dietpi-pihole.conf
+ lighttpd-enable-mod dietpi-pihole
+
+ # Optional config to block public access to admin panel
+ dps_index=$software_id Download_Install 'lighttpd.block_public_admin.conf' /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf
+ local enable_cmd='lighttpd-enable-mod dietpi-pihole-block_public_admin'
+ local disable_cmd='lighttpd-disable-mod dietpi-pihole-block_public_admin'
+
+ # - Apache
+ elif (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then
+
+ # Enable required modules
+ a2enmod headers
+
+ # Add and enable Pi-hole config
+ dps_index=$software_id Download_Install 'apache.pihole.conf' /etc/apache2/sites-available/dietpi-pihole.conf
+ a2ensite dietpi-pihole
+
+ # Optional config to block public access to admin panel
+ dps_index=$software_id Download_Install 'apache.block_public_admin.conf' /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf
+ local enable_cmd='a2ensite dietpi-pihole-block_public_admin'
+ local disable_cmd='a2dissite dietpi-pihole-block_public_admin'
+
+ # - Nginx
+ elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then
+
+ # Add Pi-hole config
+ dps_index=$software_id Download_Install 'nginx.pihole.conf' /etc/nginx/sites-dietpi/dietpi-pihole.conf
+
+ # Optional config to block public access to admin panel
+ dps_index=$software_id Download_Install 'nginx.block_public_admin.conf' /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off
+ local enable_cmd='cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.off dietpi-pihole-block_public_admin.on'
+ local disable_cmd='cd /etc/nginx/sites-dietpi; mv dietpi-pihole-block_public_admin.on dietpi-pihole-block_public_admin.off'
+
+ fi
+
+ # Ask user if they want to block report access to the admin panel
+ G_WHIP_BUTTON_OK_TEXT='YES'
+ G_WHIP_BUTTON_CANCEL_TEXT='NO'
+ G_WHIP_YESNO "In order to increase security, it is recommended that you block public access to the Pi-hole admin panel, so that unless you're on a local network, or connected via VPN, the Pi-hole admin panel isn't accessible.\n
+You can always enable/disable this at a later point using the commands:
+ - $enable_cmd
+ - $disable_cmd\n
+Do you want to block public access to the admin panel now?" && $enable_cmd
+
+ # Create symlinks to align Pi-hole admin and blocking page relative to webroot
cd /var/www
- # Move existing files/dirs out of the way
- [[ -L admin ]] || { [[ -e admin ]] && mv -v admin admin.bak; }
+ # - Move existing files/dirs out of the way
+ [[ ! -L 'admin' && -e 'admin' ]] && mv -v admin admin.bak
ln -vsf html/admin admin
- [[ -L pihole ]] || { [[ -e pihole ]] && mv -v pihole pihole.bak; }
+ [[ ! -L 'pihole' && -e 'pihole' ]] && mv -v pihole pihole.bak
ln -vsf html/pihole pihole
- # - Ask user whether to show blocking page
+ # Ask user whether to show blocking page
G_WHIP_BUTTON_OK_TEXT='YES'
G_WHIP_BUTTON_CANCEL_TEXT='NO'
if G_WHIP_YESNO 'Pi-hole can show a blocking page, when clients access a blocked website. This allows you to whitelist domains directly from the blocking page and prevents the need to access the admin page or use the Pi-hole CLI for this.\n
@@ -9168,27 +8714,41 @@ The downside is additional traffic and less performance compared to a silent req
Do you want to enable the Pi-hole blocking page?'; then
G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf
- # Link blocking page to webroot, where it is required
- [[ -L index.php ]] || { [[ -e index.php ]] && mv -v index.php index.php.bak; }
- ln -vsf pihole/index.php index.php
+ # Enable 404 handler to rewrite all non-existent ad URL paths to blocking page
+ [[ -f '/etc/apache2/sites-available/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'ErrorDocument 404' 'ErrorDocument 404 /html/pihole/index.php' /etc/apache2/sites-available/dietpi-pihole.conf
+ [[ -f '/etc/nginx/sites-dietpi/dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'error_page 404' 'error_page 404 /html/pihole/index.php;' /etc/nginx/sites-dietpi/dietpi-pihole.conf
+ [[ -f '/etc/lighttpd/conf-available/99-dietpi-pihole.conf' ]] && G_CONFIG_INJECT 'server.error-handler-404' 'server.error-handler-404 = "/html/pihole/index.php"' /etc/lighttpd/conf-available/99-dietpi-pihole.conf
+ # Backup default index page to rewrite webroot ad URL paths to blocking page
+ [[ -f 'index.html' ]] && mv index.html index.html.bak
+ [[ -f 'index.lighttpd.html' ]] && mv index.lighttpd.html index.lighttpd.html.bak
+ [[ -f 'index.nginx-debian.html' ]] && mv index.nginx-debian.html index.nginx-debian.html.bak
else
G_CONFIG_INJECT 'BLOCKINGMODE=' 'BLOCKINGMODE=NULL' /etc/pihole/pihole-FTL.conf
fi
+
+ # Failsafe: Reset permissions
+ cd /var/www/html/admin && git reset --hard HEAD
cd /tmp/$G_PROGRAM_NAME
- # - Fix service to disable syslog pre-req preventing start
+ # Fix service to disable syslog pre-req preventing start
G_CONFIG_INJECT '# Required-Stop:' '# Required-Stop: $network $remote_fs' /etc/init.d/pihole-FTL
G_CONFIG_INJECT '# Required-Start:' '# Required-Start: $network $remote_fs' /etc/init.d/pihole-FTL
systemctl enable pihole-FTL
- # - Run Gravity
+ # Disable non-required dhcpcd, which is installed by Pi-hole installer
+ systemctl disable dhcpcd
+
+ # Disable pihole.log query logging: https://github.com/pi-hole/FTL/issues/614#issuecomment-510564476
+ pihole -l off
+
+ # Run Gravity
pihole -g
- # - Generate web interface PW: https://github.com/MichaIng/DietPi/issues/662
- pihole -a -p "$GLOBAL_PW" &> /dev/null # do not print
+ # Generate web interface PW: https://github.com/MichaIng/DietPi/issues/662
+ pihole -a -p "$GLOBAL_PW"
fi
@@ -9197,16 +8757,15 @@ Do you want to enable the Pi-hole blocking page?'; then
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd airsonic &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi,audio -d $G_FP_DIETPI_USERDATA/airsonic -s $(command -v nologin) airsonic
# - Add to new "render" group on Buster
- (( $G_DISTRO > 4 )) && usermod -a -G render airsonic
+ (( $G_DISTRO > 4 )) && usermod -aG render airsonic
# Optimise memory limit
local airsonic_memory_max=$(( $RAM_TOTAL / 5 ))
(( $airsonic_memory_max < 200 )) && airsonic_memory_max=200
- airsonic_memory_max+='m'
cat << _EOF_ > /etc/systemd/system/airsonic.service
[Unit]
@@ -9217,7 +8776,7 @@ After=remote-fs.target network.target
User=airsonic
Group=dietpi
WorkingDirectory=$G_FP_DIETPI_USERDATA/airsonic
-ExecStart=$(command -v java) -Xmx$airsonic_memory_max -Dairsonic.home=$G_FP_DIETPI_USERDATA/airsonic -Dserver.context-path=/airsonic -Dserver.port=8080 -jar $G_FP_DIETPI_USERDATA/airsonic/airsonic.war
+ExecStart=$(command -v java) -Xmx${airsonic_memory_max}m -Dairsonic.home=$G_FP_DIETPI_USERDATA/airsonic -Dserver.context-path=/airsonic -Dserver.port=8080 -jar $G_FP_DIETPI_USERDATA/airsonic/airsonic.war
[Install]
WantedBy=multi-user.target
@@ -9226,6 +8785,9 @@ _EOF_
# Symlink FFmpeg to Airsonic transcoder
command -v ffmpeg &> /dev/null && ln -sf $(command -v ffmpeg) $G_FP_DIETPI_USERDATA/airsonic/transcode
+ # Permissions
+ chown -R airsonic:airsonic $G_FP_DIETPI_USERDATA/airsonic
+
# Grab our test media for user
Download_Test_Media
@@ -9236,11 +8798,11 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd subsonic &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi,audio -d /var/subsonic -s $(command -v nologin) subsonic
# - Add to new "render" group on Buster
- (( $G_DISTRO > 4 )) && usermod -a -G render subsonic
+ (( $G_DISTRO > 4 )) && usermod -aG render subsonic
# Optimise memory limit
local subsonic_memory_max=$(( $RAM_TOTAL / 5 ))
@@ -9391,11 +8953,10 @@ _EOF_
Banner_Configuration
# Remove bundled SysVinit service
- systemctl stop logitechmediaserver &> /dev/null
- systemctl disable logitechmediaserver &> /dev/null
+ systemctl disable --now logitechmediaserver &> /dev/null
killall -qwr squeezeboxserver* # Provided service may not wait for exit, kill: https://github.com/MichaIng/DietPi/issues/1613#issuecomment-372787574
- update-rc.d logitechmediaserver remove &> /dev/null
[[ -f '/etc/init.d/logitechmediaserver' ]] && rm /etc/init.d/logitechmediaserver
+ update-rc.d -f logitechmediaserver remove
[[ -f '/etc/default/logitechmediaserver' ]] && rm /etc/default/logitechmediaserver
# Grant user access to audio devices and DietPi media files
@@ -9439,8 +9000,7 @@ _EOF_
Banner_Configuration
# Enable required PHP modules: https://github.com/FreshRSS/FreshRSS#requirements
- phpenmod curl gmp intl json pdo_mysql
- (( $G_DISTRO > 3 )) && phpenmod ctype dom mbstring xml zip
+ phpenmod curl gmp intl json pdo_mysql ctype dom mbstring xml zip
# Apache configuration
if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then
@@ -9484,23 +9044,21 @@ _EOF_
fi
- #software_id=27/28/120 # TightVNC/VNC4/RealVNC Server - Shared setup
- if (( ${aSOFTWARE_INSTALL_STATE[27]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[28]} == 1 ||
- ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then
-
- #Banner_Configuration
+ # TigerVNC/RealVNC Server - Shared setup
+ if (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then
- echo -e "$GLOBAL_PW=\n$GLOBAL_PW=\nn\n" | vncpasswd
+ (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 )) && software_id=28 || software_id=120
+ Banner_Configuration
cat << _EOF_ > /etc/systemd/system/vncserver.service
[Unit]
Description=Manage VNC Server (DietPi)
Before=xrdp.service xrdp-sesman.service
-After=dietpi-boot.service dietpi-ramdisk.service dietpi-ramlog.service
+After=dietpi-boot.service
[Service]
RemainAfterExit=yes
+User=root
PAMName=login
Environment=HOME=/root
ExecStart=/usr/local/bin/vncserver start
@@ -9515,55 +9073,29 @@ _EOF_
cat << _EOF_ > /usr/local/bin/vncserver
#!/bin/bash
-# Globals
-VNC_INSTALLED=0
-BINARY_FP=0
-SHARED_MODE=0
-
-WIDTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-HEIGHT=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-DEPTH=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-DISPLAY=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-SHARED_MODE=\$(grep -m1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+# Check shared mode
+SHARED_MODE=\$(grep -cm1 '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /DietPi/dietpi.txt)
-# RealVNC | Slightly different launch method to VNC4server
+# RealVNC | Slightly different launch method to TigerVNC
REALVNC=0
if dpkg-query -s realvnc-vnc-server &> /dev/null; then
REALVNC=1
-
- #Set shared desktop mode if autostart is enabled for desktops. This prevents another VNC server being launched on :1.
- (( \$( /dev/null
- killall -qw x11vnc
- killall -qw Xtigervnc
+ DISPLAY=\$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ \$BINARY_FP -kill :\${DISPLAY:-1} &> /dev/null
+ killall -qw x11vnc Xtigervnc
;;
esac
@@ -9609,44 +9146,33 @@ _EOF_
fi
# - Stretch + TigerVNC: Disable Localhost only by default
- if (( $G_DISTRO > 3 )); then
-
- echo '$localhost = "no";' >> /etc/vnc.conf
-
- fi
-
- fi
-
- software_id=28 # VNC4/RealVNC Server
- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )); then
-
- Banner_Configuration
+ [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf
local cmd_launch_desktop=''
# DESKTOP_LXDE
if (( ${aSOFTWARE_INSTALL_STATE[23]} > 0 )); then
- cmd_launch_desktop='lxsession -s LXDE &'
+ cmd_launch_desktop='lxsession -s LXDE -e LXDE'
# DESKTOP_MATE
elif (( ${aSOFTWARE_INSTALL_STATE[24]} > 0 )); then
- cmd_launch_desktop='mate-session &'
+ cmd_launch_desktop='mate-session'
# DESKTOP_GNUSTEP
elif (( ${aSOFTWARE_INSTALL_STATE[26]} > 0 )); then
- cmd_launch_desktop='x-window-manager &'
+ cmd_launch_desktop='x-window-manager'
# DESKTOP_XFCE
elif (( ${aSOFTWARE_INSTALL_STATE[25]} > 0 )); then
- cmd_launch_desktop='xfce4-session &'
+ cmd_launch_desktop='xfce4-session'
# DESKTOP_LXQT
elif (( ${aSOFTWARE_INSTALL_STATE[173]} > 0 )); then
- cmd_launch_desktop='startlxqt &'
+ cmd_launch_desktop='startlxqt'
fi
@@ -9658,10 +9184,17 @@ export SHELL='/bin/bash'
[[ -r '/root/.Xresources' ]] && xrdb /root/.Xresources
xsetroot -solid grey
vncconfig -iconic &
-$cmd_launch_desktop
+$cmd_launch_desktop &
_EOF_
chmod +x /root/.vnc/xstartup
+ # Set control + read-only passwords
+ vncpasswd -f << _EOF_ > /root/.vnc/passwd
+$GLOBAL_PW
+$GLOBAL_PW
+_EOF_
+ chmod 600 /root/.vnc/passwd
+
fi
software_id=74 # InfluxDB
@@ -9670,9 +9203,13 @@ _EOF_
Banner_Configuration
# Move DB/datadir to userdata location
- mv /var/lib/influxdb $G_FP_DIETPI_USERDATA/
+ [[ -d $G_FP_DIETPI_USERDATA/influxdb ]] || mv /var/lib/influxdb $G_FP_DIETPI_USERDATA/
+ rm -Rf /var/lib/influxdb
ln -sf $G_FP_DIETPI_USERDATA/influxdb /var/lib/influxdb
+ # Permissions
+ chown -R influxdb:influxdb $G_FP_DIETPI_USERDATA/influxdb
+
fi
software_id=77 # Grafana
@@ -9684,7 +9221,7 @@ _EOF_
if [[ -d $G_FP_DIETPI_USERDATA/grafana ]]; then
G_DIETPI-NOTIFY 2 "Existing database/plugin directory $G_FP_DIETPI_USERDATA/grafana found. Will not overwrite..."
- [[ -e '/var/lib/grafana' ]] && rm -R /var/lib/grafana
+ rm -Rf /var/lib/grafana
else
@@ -9693,6 +9230,9 @@ _EOF_
fi
ln -sf $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana
+ # Permissions
+ chown -R grafana:grafana $G_FP_DIETPI_USERDATA/grafana
+
# Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password
GCI_PASSWORD=1 GCI_PRESERVE=1 G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini
G_CONFIG_INJECT 'http_port = ' 'http_port = 3001' /etc/grafana/grafana.ini
@@ -9704,13 +9244,12 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd ubooquity &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -s $(command -v nologin) ubooquity
- mkdir -p $G_FP_DIETPI_USERDATA/ebooks $G_FP_DIETPI_USERDATA/comics
+ mkdir -p $G_FP_DIETPI_USERDATA/{ebooks,comics}
- chmod +x $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar
cat << _EOF_ > /etc/systemd/system/ubooquity.service
[Unit]
Description=Ubooquity (DietPi)
@@ -9725,6 +9264,10 @@ ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chmod +x $G_FP_DIETPI_USERDATA/ubooquity/Ubooquity.jar
+ chown -R ubooquity:dietpi $G_FP_DIETPI_USERDATA/ubooquity
+
fi
software_id=64 # phpSysInfo
@@ -9792,48 +9335,58 @@ _EOF_
Banner_Configuration
- local key_size=2048
-
- # Start Cert/Key generation.
- cp -a /usr/share/easy-rsa/ /etc/openvpn
- mkdir -p /etc/openvpn/easy-rsa/keys
- cat << _EOF_ >> /etc/openvpn/easy-rsa/vars
-export KEY_SIZE=$key_size
-export KEY_COUNTRY='UK'
-export KEY_PROVINCE='DietPi'
-export KEY_CITY='DietPi'
-export KEY_ORG='DietPi'
-export KEY_EMAIL='noreply@DietPi.com'
-export KEY_OU='DietPi'
-export KEY_NAME='DietPi_OpenVPN_Server'
-_EOF_
-
- # Create Server Cert Auth
- 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
- chmod -R +x /etc/openvpn/easy-rsa
- cd /etc/openvpn/easy-rsa
- # - https://github.com/MichaIng/DietPi/issues/1450#issuecomment-362608574
- (( $G_DISTRO > 3 )) && cp -a openssl-1.0.0.cnf openssl.cnf
+ # Create initial server and client configs, if not yet present
+ # - Wildcard config file detection via for loop
+ local i
+ for i in /etc/openvpn/*.conf
+ do
- . ./vars
- ./clean-all
- ./build-ca --batch DietPi_OpenVPN_Server
- ./build-key-server --batch DietPi_OpenVPN_Server
+ # Inform user, if config exist, that config generation is skipped
+ if [[ -f $i ]]; then
- # Copy Server cert/keys
- cp -a /etc/openvpn/easy-rsa/keys/{DietPi_OpenVPN_Server.crt,DietPi_OpenVPN_Server.key,ca.crt} /etc/openvpn/
+ G_DIETPI-NOTIFY 2 "Existing OpenVPN configuration found: $i
+ - Config generation will be skipped.
+ - If you need a fresh key/cert/config set, please remove $i
+ and run: dietpi-software reinstall 97"
+ break
- # Build client cert/keys
- ./build-key --batch DietPi_OpenVPN_Client
+ fi
- cd /tmp/$G_PROGRAM_NAME
- # End Cert/Key generation.
+ # Pre-v6.26 cleanup
+ [[ -f '/etc/openvpn/dh2048.pem' ]] && rm /etc/openvpn/dh2048.pem
+ dpkg-query -s easy-rsa &> /dev/null && G_AGP easy-rsa
- # Server config
- cat << _EOF_ > /etc/openvpn/server.conf
+ # Download latest easy-rsa from GitHub
+ G_DIETPI-NOTIFY 2 'Downloading latest easy-rsa for certificate and key generation...'
+ INSTALL_URL_ADDRESS='https://api.github.com/repos/OpenVPN/easy-rsa/releases/latest'
+ G_CHECK_URL "$INSTALL_URL_ADDRESS"
+ fallback_url='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-v3.0.6.tgz'
+ no_check_url=1 Download_Install "$(curl -s "$INSTALL_URL_ADDRESS" | grep -m1 '"browser_download_url.*EasyRSA-.*\.tgz' | cut -d \" -f 4)"
+ [[ -d '/etc/openvpn/easy-rsa' ]] && rm -R /etc/openvpn/easy-rsa
+ mv EasyRSA-* /etc/openvpn/easy-rsa
+
+ # Cert and key generation via easy-rsa
+ G_DIETPI-NOTIFY 2 'Generating unique OpenVPN certificates and keys. Please wait...\n'
+ cd /etc/openvpn/easy-rsa
+ cat << _EOF_ > vars
+set_var EASYRSA_REQ_COUNTRY "UK"
+set_var EASYRSA_REQ_PROVINCE "DietPi"
+set_var EASYRSA_REQ_CITY "DietPi"
+set_var EASYRSA_REQ_ORG "DietPi"
+set_var EASYRSA_REQ_EMAIL "noreply@dietpi.com"
+set_var EASYRSA_REQ_OU "DietPi"
+set_var EASYRSA_BATCH "1"
+_EOF_
+ ./easyrsa init-pki
+ ./easyrsa build-ca nopass
+ ./easyrsa gen-dh
+ ./easyrsa build-server-full DietPi_OpenVPN_Server nopass
+ ./easyrsa build-client-full DietPi_OpenVPN_Client nopass
+
+ # Server config
+ cp -a pki/{ca.crt,dh.pem,issued/DietPi_OpenVPN_Server.crt,private/DietPi_OpenVPN_Server.key} /etc/openvpn/
+ cd /etc/openvpn
+ cat << _EOF_ > server.conf
port 1194
proto udp
dev tun
@@ -9841,7 +9394,7 @@ dev tun
ca ca.crt
cert DietPi_OpenVPN_Server.crt
key DietPi_OpenVPN_Server.key
-dh dh$key_size.pem
+dh dh.pem
server 10.8.0.0 255.255.255.0
@@ -9860,16 +9413,15 @@ verb 3
# Web Forwarding (uncomment to enable)
#push "redirect-gateway"
#push "dhcp-option DNS 10.8.0.1"
-
_EOF_
- # Client config
- cat << _EOF_ > /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
+ # Client config
+ cat << _EOF_ > DietPi_OpenVPN_Client.ovpn
client
proto udp
dev tun
-# Ip/Domain name of DietPi system, running OpenVPN server.
+# IP/domain name of DietPi system, running OpenVPN server
remote mywebsite.com 1194
resolv-retry infinite
@@ -9881,30 +9433,25 @@ group nogroup
persist-key
persist-tun
-ns-cert-type server
+remote-cert-tls server
comp-lzo
verb 3
-
_EOF_
+ # - Add CA cert, client cert and key
+ echo -e "
+\n$(
+\n$(
+\n$(" >> DietPi_OpenVPN_Client.ovpn
- # Unified client file. Add DietPi generated certs/keys.
- # - Add Server Cert auth
- echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- cat /etc/openvpn/ca.crt >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- # - Add Client Cert
- echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- cat /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.crt >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- # - Add Client Key
- echo '' >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- cat /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.key >> /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn
- 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 $G_FP_DIETPI_USERDATA/
- # - and /boot partition
- cp /etc/openvpn/easy-rsa/keys/DietPi_OpenVPN_Client.ovpn /boot/
+ # - Copy to userdata
+ cp DietPi_OpenVPN_Client.ovpn $G_FP_DIETPI_USERDATA/
+ # - and /boot partition
+ cp DietPi_OpenVPN_Client.ovpn /boot/
+
+ cd /tmp/$G_PROGRAM_NAME
+ break # Always break loop which is only for single wildcard file detection
+
+ done
# Enable IP forwarding
echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-openvpn.conf
@@ -10099,10 +9646,10 @@ If no WireGuard (auto)start is included, but you require it, please do the follo
Banner_Configuration
- local eth_index=$(sed -n 1p /DietPi/dietpi/.network)
- local wifi_index=$(sed -n 2p /DietPi/dietpi/.network)
+ local eth_index=$(mawk 'NR==1 {print}' /DietPi/dietpi/.network)
+ local wifi_index=$(mawk 'NR==2 {print}' /DietPi/dietpi/.network)
- # - DHCPD Config
+ # DHCPD Config
G_BACKUP_FP /etc/dhcp/dhcpd.conf
cat << _EOF_ > /etc/dhcp/dhcpd.conf
ddns-update-style none;
@@ -10120,16 +9667,16 @@ subnet 192.168.42.0 netmask 255.255.255.0 {
}
_EOF_
- # - Assign wlan as interface for dhcp server.
+ # Assign detected WLAN interface
echo "INTERFACESv4=\"wlan$wifi_index\"" > /etc/default/isc-dhcp-server
- # - Remove all entries below wlan, so we can recreate them.
+ # Remove all entries below wlan, so we can recreate them
sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces
- # - Enable up wlan
- sed -i "/allow-hotplug wlan/c\allow-hotplug wlan$wifi_index" /etc/network/interfaces
+ # Enable up wlan
+ G_CONFIG_INJECT 'allow-hotplug wlan' "allow-hotplug wlan$wifi_index" /etc/network/interfaces
- # - Add wifi settings to network interfaces config
+ # Add WiFi settings to network interfaces config
cat << _EOF_ >> /etc/network/interfaces
iface wlan$wifi_index inet static
address 192.168.42.1
@@ -10142,46 +9689,46 @@ wireless-power off
up iptables-restore < /etc/iptables.ipv4.nat
_EOF_
- # - Assign static IP for wlan now
+ # Assign static IP for wlan now
ip a add 192.168.42.1 dev wlan$wifi_index
- # - Create access point config
+ # Create access point config
G_BACKUP_FP /etc/hostapd/hostapd.conf
cat << _EOF_ > /etc/hostapd/hostapd.conf
interface=wlan$wifi_index
driver=nl80211
-ssid=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ssid=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
hw_mode=g
-channel=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+channel=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
-wpa_passphrase=$(grep -m1 '^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+wpa_passphrase=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
_EOF_
- # - Check for RTL8188C* device, use the patched driver with compiled binary: https://github.com/pritambaral/hostapd-rtl871xdrv#why
+ # Check for RTL8188C* device, use the patched driver with compiled binary: https://github.com/pritambaral/hostapd-rtl871xdrv#why
(( $WIFIHOTSPOT_RTL8188C_DEVICE )) && G_CONFIG_INJECT 'driver=' 'driver=rtl871xdrv' /etc/hostapd/hostapd.conf
- # - Enable access point config
+ # Enable access point config
echo "DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"" > /etc/default/hostapd
- # - Enable IP forwarding
+ # Enable IP forwarding
echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.all.forwarding=1\nnet.ipv6.conf.default.forwarding=1' > /etc/sysctl.d/dietpi-wifihotspot.conf
sysctl net.ipv4.ip_forward=1 net.ipv6.conf.all.forwarding=1 net.ipv6.conf.default.forwarding=1
- # - Apply iptables
+ # Apply IP tables
iptables -t nat -A POSTROUTING -o eth$eth_index -j MASQUERADE
iptables -A FORWARD -i eth$eth_index -o wlan$wifi_index -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan$wifi_index -o eth$eth_index -j ACCEPT
- # - Save IP tables, applied during ifup in /etc/network/interfaces.
+ # Save IP tables, applied during ifup in /etc/network/interfaces
iptables-save > /etc/iptables.ipv4.nat
- # - RPi 3/4 Onboard WiFi: Enable N support
+ # RPi3/4 onboard WiFi: Enable N support
(( ( $G_HW_MODEL == 3 || $G_HW_MODEL == 4 ) && ! $WIFIHOTSPOT_RTL8188C_DEVICE )) && G_CONFIG_INJECT 'ieee80211n=' 'ieee80211n=1' /etc/hostapd/hostapd.conf
fi
@@ -10260,7 +9807,9 @@ alsa =
_EOF_
# Create shairport user
- useradd -rM shairport-sync -G audio -s $(command -v nologin)
+ local usercmd='useradd -rMU'
+ getent passwd shairport-sync &> /dev/null && usercmd='usermod -a'
+ $usercmd -G audio -s $(command -v nologin) shairport-sync
chmod +x /usr/local/bin/shairport-sync
@@ -10272,8 +9821,7 @@ _EOF_
Banner_Configuration
# PHP configuration
- phpenmod apcu gd intl pdo_mysql
- (( $G_DISTRO > 3 )) && phpenmod dom mbstring xml
+ phpenmod apcu gd intl pdo_mysql dom mbstring xml
# Webserver config
# - Apache2
@@ -10292,16 +9840,7 @@ _EOF_
# - Enable Lighttpd setenv, access and rewrite modules
G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
G_CONFIG_INJECT '"mod_setenv",' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
- # - On Jessie rewrite.ini is not available, thus "lighttpd-enable-mod rewrite" does not work.
- if (( $G_DISTRO < 4 )); then
-
- G_CONFIG_INJECT '"mod_rewrite",' ' "mod_rewrite",' /etc/lighttpd/lighttpd.conf '"mod_.+",'
-
- else
-
- lighttpd-enable-mod rewrite
-
- fi
+ lighttpd-enable-mod rewrite
# - Move Pydio Lighttpd config in place
dps_index=$software_id Download_Install 'lighttpd.pydio.conf' /etc/lighttpd/conf-available/99-dietpi-pydio.conf
@@ -10336,6 +9875,7 @@ _EOF_
# Create symlink
ln -sf $target_data_dir /var/www/pydio/data
+ chown -R www-data:www-data $target_data_dir
fi
@@ -10344,9 +9884,10 @@ _EOF_
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
+ # Replace sysvinit service with systemd
+ [[ -f '/etc/init.d/squeezelite' ]] && rm /etc/init.d/squeezelite
+ update-rc.d -f squeezelite remove
+ [[ -f '/etc/default/squeezelite' ]] && rm /etc/default/squeezelite
dps_index=$software_id Download_Install 'squeezelite.service' /etc/systemd/system/squeezelite.service
Download_Test_Media
@@ -10358,40 +9899,31 @@ _EOF_
Banner_Configuration
- # - Copy configs
+ # Copy config
cp /etc/emonhub/conf/default/emonhub /etc/default/emonhub
- # - Setup service
+ # Setup service
cp /etc/emonhub/service/emonhub /etc/init.d/emonhub
chmod +x /etc/init.d/emonhub
update-rc.d emonhub defaults
chmod +x -R /etc/emonhub
- # RPI 3 - Must disable BCM BT to recover UART 0
- #RPI4: test required.
- if (( $G_HW_MODEL == 3 )); then
+ # Disable onboard Bluetooth, if present, to recover ttyAMA0
+ # RPi4: Test required
+ if (( $(sed -n 10p /DietPi/dietpi/.hw_model) )); then
- # - Add DToverlay to disable bluetooth
- if ! grep -qi '=pi3-disable-bt' /DietPi/config.txt; then
+ /DietPi/dietpi/func/dietpi-set_hardware bluetooth disable
- echo -e '\ndtoverlay=pi3-disable-bt' >> /DietPi/config.txt
-
- # - Enable
- else
-
- sed -i '/pi3-disable-bt/c\dtoverlay=pi3-disable-bt' /DietPi/config.txt
-
- fi
+ # Else, assure that primary UART is enabled, which is ttyAMA0 on non-onboard WiFi/BT models
+ else
- # - Disable bluetooth service
- systemctl stop hciuart
- systemctl disable hciuart
+ G_CONFIG_INJECT 'enable_uart=' 'enable_uart=1' $FP_RPI_CONFIG
fi
- #RPi - Disable serial tty that emonPi uses.
- /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
+ # Disable console on ttyAMA0
+ /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable ttyAMA0
# - Apply user API KEY
USER_EMONHUB_APIKEY_CURRENT=$(grep -m1 '^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
@@ -10455,37 +9987,30 @@ _EOF_
Banner_Configuration
- # Only required for our custom package, leave defaults for Debian APT package otherwise
- if (( $G_DISTRO < 4 || ( $G_HW_MODEL < 10 && $G_DISTRO < 5 ) )); then
+ # Only required for our self-compiled package, leave defaults for Debian APT package otherwise
+ if (( $G_HW_ARCH == 1 && $G_DISTRO < 5 )); then
- # - Service
+ # Service
dps_index=$software_id Download_Install 'netdata.service' /etc/systemd/system/netdata.service
- # Workaround for Jessie
- if (( $G_DISTRO < 4 )); then
- sed -i '\#ExecStartPre=/bin/chown -R netdata:netdata /var/run/netdata#d' /etc/systemd/system/netdata.service
- sed -Ei '\#ProtectKernel(Modules|Tunables)=no#d' /etc/systemd/system/netdata.service
-
- fi
+ # Dir (failsafe)
+ mkdir -p /var/lib/netdata
- # - User
- local usercmd='useradd -rm'
+ # User
+ local usercmd='useradd -rMU'
getent passwd netdata &> /dev/null && usercmd='usermod'
$usercmd -d /var/lib/netdata -s $(command -v nologin) netdata
- # - Permissions: https://docs.netdata.cloud/docs/netdata-security/#netdata-directories
- # R/O
+ # Permissions: https://docs.netdata.cloud/docs/netdata-security/#netdata-directories
+ # - R/O
chown -R root:netdata /etc/netdata /usr/lib/netdata /usr/libexec/netdata /usr/share/netdata
chmod -R 0750 /etc/netdata /usr/lib/netdata /usr/libexec/netdata /usr/share/netdata
- # apps.plugin requires root privileges to read disk I/O
+ # - apps.plugin requires root privileges to read disk I/O
chmod 4750 /usr/libexec/netdata/plugins.d/apps.plugin
- # R/W
- chown -R netdata:netdata /var/cache/netdata /var/lib/netdata /var/log/netdata
+ # - R/W (web access: https://github.com/MichaIng/DietPi/issues/2336#issuecomment-450196178)
+ chown -R netdata:netdata /var/cache/netdata /var/lib/netdata /var/log/netdata /usr/share/netdata/web
chmod -R 0770 /var/cache/netdata /var/lib/netdata /var/log/netdata
- # Required: https://github.com/MichaIng/DietPi/issues/2336#issuecomment-450196178
- chown -R netdata:netdata /usr/share/netdata/web
-
fi
fi
@@ -10495,24 +10020,27 @@ _EOF_
Banner_Configuration
- /DietPi/dietpi/func/dietpi-set_software setpermissions &> /dev/null
+ # Permissions: http://sabre.io/baikal/install/
+ chown -R www-data:www-data /var/www/baikal/Specific
+
+ # Enable required PHP modules: https://github.com/sabre-io/Baikal/wiki/Baïkal-dependencies
+ phpenmod xml mbstring pdo_mysql
- # - install/run composer | Also run for ampache. Move this to a global function....
+ # Install/run composer | Also run for ampache. Move this to a global function....
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
cd /var/www/baikal
composer install --no-interaction
cd /tmp/$G_PROGRAM_NAME
- # - Mysql DB
+ # Database
/DietPi/dietpi/func/create_mysql_db baikal baikal "$GLOBAL_PW"
- # - Cal/CardDAV request redirection: http://sabre.io/baikal/install/, https://github.com/bambocher/docker-baikal/blob/master/lighttpd.conf
- # - Apache
+ # Cal/CardDAV request redirection: http://sabre.io/baikal/install/, https://github.com/bambocher/docker-baikal/blob/master/lighttpd.conf
+ # - Apache
if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )); then
echo '# Redirect Cal/CardDAV requests to Baikal endpoint:
@@ -10520,7 +10048,7 @@ Redirect permanent /.well-known/carddav /baikal/html/dav.php
Redirect permanent /.well-known/caldav /baikal/html/dav.php' > /etc/apache2/conf-available/dietpi-dav_redirect.conf
a2enconf dietpi-dav_redirect
- # - Lighttpd
+ # - Lighttpd
elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )); then
echo '# Redirect Cal/CardDAV requests to Baikal endpoint:
@@ -10530,7 +10058,7 @@ url.redirect += (
)' > /etc/lighttpd/conf-available/99-dietpi-dav_redirect.conf
lighttpd-enable-mod dietpi-dav_redirect
- # - Nginx
+ # - Nginx
elif (( ${aSOFTWARE_INSTALL_STATE[85]} > 0 )); then
echo '# Redirect Cal/CardDAV requests to Baikal endpoint:
@@ -10600,7 +10128,7 @@ location = /.well-known/caldav {
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd cuberite &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/cubrite -s $(command -v nologin) cuberite
@@ -10629,6 +10157,9 @@ Ports=1339
Enabled=1
_EOF_
+ # Permissions
+ chown -R cuberite:dietpi $G_FP_DIETPI_USERDATA/cubrite
+
fi
software_id=53 # MineOS
@@ -10637,8 +10168,7 @@ _EOF_
Banner_Configuration
# Add underprivilged user for web access | no longer works, could be a nodejs v8 issue?
- useradd mineos
- echo -e "$GLOBAL_PW\n$GLOBAL_PW\n" | passwd mineos
+ getent passwd mineos &> /dev/null || useradd -p "$GLOBAL_PW" mineos
# 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 # Already done after install step now
@@ -10646,24 +10176,23 @@ _EOF_
killall -w node &> /dev/null
killall -w nodejs &> /dev/null
- # - Create symlinks to userdata dir
+ # Create symlinks to userdata dir
mkdir -p $G_FP_DIETPI_USERDATA/mineos/minecraft
ln -sf $G_FP_DIETPI_USERDATA/mineos/minecraft/mineos_console.js /usr/local/bin/mineos
G_BACKUP_FP /etc/mineos.conf
cp $G_FP_DIETPI_USERDATA/mineos/minecraft/mineos.conf /etc/mineos.conf
- rm -R /var/games/minecraft &> /dev/null
- mkdir -p /var/games
- mkdir -p $G_FP_DIETPI_USERDATA/mineos/serverdata
- ln -sf $G_FP_DIETPI_USERDATA/mineos/serverdata /var/games/minecraft
+ rm -Rf /var/games/minecraft
+ mkdir -p /var/games $G_FP_DIETPI_USERDATA/mineos/serverdata
+ ln -s $G_FP_DIETPI_USERDATA/mineos/serverdata /var/games/minecraft
- # - setup SSL cert
+ # Setup SSL cert
cd $G_FP_DIETPI_USERDATA/mineos/minecraft
./generate-sslcert.sh
cd /tmp/$G_PROGRAM_NAME
- # - Supervisor service
+ # Supervisor service
cat << _EOF_ > /etc/supervisor/conf.d/mineos.conf
[program:mineos]
command=/usr/local/bin/node webui.js
@@ -10674,9 +10203,11 @@ autostart=true
autorestart=true
redirect_stderr=true
_EOF_
-
supervisorctl reload
+ # Permissions
+ chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos /var/games/minecraft /etc/ssl/certs/mineos*
+
fi
software_id=49 # Gogs
@@ -10685,16 +10216,22 @@ _EOF_
Banner_Configuration
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd gogs &> /dev/null && usercmd='usermod'
$usercmd -d /etc/gogs -s $(command -v nologin) gogs
- # Directories
+ # Directories + permissions
mkdir -p $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs
- chown -R gogs:gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs
+ chown -R gogs:gogs /etc/gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs
# Database
- /DietPi/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW"
+ if [[ ! -d '/var/lib/mysql/gogs' ]]; then
+
+ G_RUN_CMD systemctl restart mariadb
+ mysql < /etc/gogs/scripts/mysql.sql
+ mysql -e "grant all privileges on gogs.* to gogs@localhost identified by '$GLOBAL_PW'"
+
+ fi
# Service
cat << _EOF_ > /etc/systemd/system/gogs.service
@@ -10719,7 +10256,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rm'
+ local usercmd='useradd -rMU'
getent passwd qbittorrent &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -p "$GLOBAL_PW" -s $(command -v nologin) qbittorrent
@@ -10804,9 +10341,6 @@ enabled=false
program=
_EOF_
- # - Jessie WebUI\Password_ha1 breaks login with m5dsum generated pw, revert to default 'adminadmin': https://github.com/MichaIng/DietPi/issues/1499#issuecomment-364769146
- (( $G_DISTRO < 4 )) && sed -i '/Password_ha1=/d' /root/.config/qBittorrent/qBittorrent.conf
-
# Service
cat << _EOF_ > /etc/systemd/system/qbittorrent.service
[Unit]
@@ -10823,6 +10357,9 @@ ExecStart=/usr/bin/qbittorrent-nox --webui-port=1340
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R qbittorrent:dietpi /home/qbittorrent
+
fi
software_id=107 # rTorrent
@@ -10930,7 +10467,7 @@ _EOF_
mkdir -p $G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS/.session
# Create rTorrent run user
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd rtorrent &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/rtorrent -s $(command -v nologin) rtorrent
@@ -11094,7 +10631,7 @@ scgi_port = 127.0.0.1:5000
_EOF_
# On Buster use new daemon mode
(( $G_DISTRO > 4 )) && G_CONFIG_INJECT 'system.daemon.set[[:blank:]=]' 'system.daemon.set = true' $G_FP_DIETPI_USERDATA/rtorrent/.rtorrent.rc
- chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent
+ chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent $G_FP_DIETPI_USERDATA/downloads/.session
fi
@@ -11103,61 +10640,90 @@ _EOF_
Banner_Configuration
- G_BACKUP_FP /var/lib/dietpi/dietpi-software/installed/aria2.conf
- cat << _EOF_ > /var/lib/dietpi/dietpi-software/installed/aria2.conf
-# The fallowing options are aria2c options as usual aria2.conf file
-# https://aria2.github.io/manual/en/html/aria2c.html
-
-# Download directory
-dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS
+ # User
+ local usercmd='useradd -rMN'
+ getent passwd aria2 &> /dev/null && usercmd='usermod'
+ $usercmd -g dietpi -d $G_FP_DIETPI_USERDATA/aria2 -s $(command -v nologin) aria2
-# RPC Options
-enable-rpc=true
-rpc-listen-all=true
-rpc-listen-port=6800
-rpc-secret=$GLOBAL_PW
-rpc-allow-origin-all=true
-pause=false
+ # Config
+ mkdir -p $G_FP_DIETPI_USERDATA/aria2
+ [[ -f $G_FP_DIETPI_USERDATA/aria2/aria2.conf ]] || cat << _EOF_ > $G_FP_DIETPI_USERDATA/aria2/aria2.conf
+# DietPi default aria2c options served as aria2.conf file via --conf-path
+# https://aria2.github.io/manual/en/html/aria2c.html#options
-# General Options
+# Logging
log=/var/log/aria2.log
log-level=warn
-split=$(Optimise_BitTorrent 1)
+# Session
+always-resume=true
continue=true
-check-integrity=true
+input-file=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS/aria2.session
+save-session=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS/aria2.session
+save-session-interval=60
+
+# Connection
+listen-port=6881-6999
+ftp-pasv=true
+check-certificate=false
+# - Count
max-concurrent-downloads=$(Optimise_BitTorrent 1)
+split=$(Optimise_BitTorrent 1)
max-connection-per-server=$(Optimise_BitTorrent 1)
-# Bandwidth limits: https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-max-overall-upload-limit
-max-overall-download-limit=0
-max-overall-upload-limit=0
-max-file-not-found=3
-max-tries=5
-retry-wait=60
-ftp-pasv=true
bt-max-peers=$(Optimise_BitTorrent 2)
-listen-port=6881-6999
-check-certificate=false
-
+# - Bandwidth
max-overall-upload-limit=0
max-upload-limit=0
max-overall-download-limit=0
max-download-limit=0
-seed-ratio=0.1
-seed-time=0
+# - Retries
+max-file-not-found=3
+max-tries=5
+retry-wait=60
+
+# RPC
+enable-rpc=true
+rpc-listen-all=true
+rpc-listen-port=6800
+rpc-secret=$GLOBAL_PW
+rpc-allow-origin-all=true
+pause=false
+# Store
+dir=$G_FP_DIETPI_USERDATA/$FOLDER_DOWNLOADS
allow-overwrite=false
-always-resume=true
auto-file-renaming=false
file-allocation=none
+check-integrity=true
+
+# Seeding
+seed-ratio=0.1
+seed-time=0
_EOF_
+ # Pre-create log file
+ local fp_log=$(sed -n '/^[[:blank:]]*log=/{s/^[^=]*=//p;q}' $G_FP_DIETPI_USERDATA/aria2/aria2.conf)
+ [[ ${fp_log//\"} && ! -f $fp_log ]] && >> $fp_log
+
+ # Pre-create input file
+ local fp_input=$(sed -n '/^[[:blank:]]*input-file=/{s/^[^=]*=//p;q}' $G_FP_DIETPI_USERDATA/aria2/aria2.conf)
+ [[ ${fp_input//\"} && ! -f $fp_input ]] && >> $fp_input
+
+ # Permissions
+ chown -R aria2:root $G_FP_DIETPI_USERDATA/aria2 $fp_input
+ chown aria2:dietpi $fp_log
+ chmod 600 $G_FP_DIETPI_USERDATA/aria2/aria2.conf
+ unset fp_log fp_input
+
+ # Service
cat << _EOF_ > /etc/systemd/system/aria2.service
[Unit]
Description=Aria2 (DietPi)
[Service]
-ExecStart=$(command -v aria2c) --conf-path=/var/lib/dietpi/dietpi-software/installed/aria2.conf
+User=aria2
+UMask=002
+ExecStart=$(command -v aria2c) --conf-path=$G_FP_DIETPI_USERDATA/aria2/aria2.conf
[Install]
WantedBy=multi-user.target
@@ -11238,16 +10804,17 @@ _EOF_
Banner_Configuration
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd medusa &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/medusa -s $(command -v nologin) medusa
# Service
cp $G_FP_DIETPI_USERDATA/medusa/runscripts/init.systemd /etc/systemd/system/medusa.service
G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service '\[Service\]'
- local python_bin='python'
- (( $G_DISTRO > 3 )) && python_bin+='3'
- G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v $python_bin) $G_FP_DIETPI_USERDATA/medusa/start.py -q --nolaunch --datadir=$G_FP_DIETPI_USERDATA/medusa" /etc/systemd/system/medusa.service
+ G_CONFIG_INJECT 'ExecStart=' "ExecStart=$(command -v python3) $G_FP_DIETPI_USERDATA/medusa/start.py -q --nolaunch --datadir=$G_FP_DIETPI_USERDATA/medusa" /etc/systemd/system/medusa.service
+
+ # Permissions
+ chown -R medusa:dietpi $G_FP_DIETPI_USERDATA/medusa
fi
@@ -11256,7 +10823,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rm'
+ local usercmd='useradd -rMU'
getent passwd tonido &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -s $(command -v nologin) tonido
@@ -11276,15 +10843,16 @@ WantedBy=multi-user.target
_EOF_
# User dirs
- mkdir -p $G_FP_DIETPI_USERDATA/tonido/sync
- mkdir -p $G_FP_DIETPI_USERDATA/tonido/syncdata
-
+ mkdir -p /home/tonido $G_FP_DIETPI_USERDATA/tonido/sync{,data}
# - Symlink
- cp -R /home/tonido/tonido $G_FP_DIETPI_USERDATA/ &> /dev/null
- rm -R /home/tonido/tonido &> /dev/null
- ln -sf $G_FP_DIETPI_USERDATA/tonido /home/tonido/tonido
- ln -sf $G_FP_DIETPI_USERDATA/tonido/sync /home/tonido/TonidoSync
- ln -sf $G_FP_DIETPI_USERDATA/tonido/syncdata /home/tonido/TonidoSyncData
+ [[ -d '/home/tonido/tonido' ]] && cp -a /home/tonido/tonido $G_FP_DIETPI_USERDATA/ &> /dev/null
+ rm -Rf /home/tonido/{tonido,TonidoSync{,Data}}
+ ln -s $G_FP_DIETPI_USERDATA/tonido /home/tonido/tonido
+ ln -s $G_FP_DIETPI_USERDATA/tonido/sync /home/tonido/TonidoSync
+ ln -s $G_FP_DIETPI_USERDATA/tonido/syncdata /home/tonido/TonidoSyncData
+
+ # Permissions
+ chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido /home/tonido
# ARMv7 switch
if (( $G_HW_ARCH == 2 )); then
@@ -11397,10 +10965,10 @@ _EOF_
# Database will be migrated automatically, so only create new on fresh install, using local override config as flag
if [[ ! -f '/var/www/ompd/include/config.local.inc.php' ]]; then
- G_RUN_CMD systemctl start $MARIADB_SERVICE
+ G_RUN_CMD systemctl start mariadb
# - Create database user only, database will be created automatically
- mysql -e "grant all privileges on ompd.* to ompd@localhost identified by '$GLOBAL_PW';"
- systemctl stop $MARIADB_SERVICE
+ mysql -e "grant all privileges on ompd.* to ompd@localhost identified by '$GLOBAL_PW'"
+ systemctl stop mariadb
cat << _EOF_ > /var/www/ompd/include/config.local.inc.php
/etc/systemd/system/darkice.service
[Unit]
Description=DarkIce (DietPi)
@@ -11498,7 +11070,8 @@ _EOF_
Banner_Configuration
- rm /etc/init.d/mosquitto
+ [[ -f '/etc/init.d/mosquitto' ]] && rm /etc/init.d/mosquitto
+ update-rc.d -f mosquitto remove
cat << _EOF_ > /etc/systemd/system/mosquitto.service
[Unit]
Description=Mosquitto (DietPi)
@@ -11531,7 +11104,7 @@ _EOF_
fi
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd blynk &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/blynk -s $(command -v nologin) blynk
@@ -11551,6 +11124,9 @@ ExecStart=$(command -v java) -jar $G_FP_DIETPI_USERDATA/blynk/blynkserver.jar
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk /var/log/blynk
+
fi
software_id=136 # MotionEye
@@ -11617,7 +11193,7 @@ _EOF_
Banner_Configuration
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd sabnzbd &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d /etc/sabnzbd -s $(command -v nologin) sabnzbd
@@ -11731,7 +11307,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd koel &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -s $(command -v nologin) koel
@@ -11771,6 +11347,9 @@ ExecStart=$(command -v php) $G_FP_DIETPI_USERDATA/koel/artisan serve --host 0.0.
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R koel:dietpi $G_FP_DIETPI_USERDATA/koel
+
fi
software_id=144 # Sonarr
@@ -11778,7 +11357,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd sonarr &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/sonarr -s $(command -v nologin) sonarr
@@ -11798,7 +11377,7 @@ ExecStart=/usr/bin/mono -O=-aot /opt/NzbDrone/NzbDrone.exe -nobrowser -data=$G_F
WantedBy=multi-user.target
_EOF_
- # - logs to RAM
+ # Logs to RAM
rm -R $G_FP_DIETPI_USERDATA/sonarr/logs* &> /dev/null
mkdir -p /var/log/sonarr
ln -sf /var/log/sonarr $G_FP_DIETPI_USERDATA/sonarr/logs
@@ -11806,6 +11385,9 @@ _EOF_
ln -sf /var/log/sonarr/logs.db-shm $G_FP_DIETPI_USERDATA/sonarr/logs.db-shm
ln -sf /var/log/sonarr/logs.db-wal $G_FP_DIETPI_USERDATA/sonarr/logs.db-wal
+ # Permissions
+ chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr /opt/NzbDrone /var/log/sonarr
+
fi
software_id=145 # Radarr
@@ -11813,7 +11395,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd radarr &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/radarr -s $(command -v nologin) radarr
@@ -11833,7 +11415,7 @@ ExecStart=/usr/bin/mono -O=-aot /opt/Radarr/Radarr.exe -nobrowser -data=$G_FP_DI
WantedBy=multi-user.target
_EOF_
- # - logs to RAM
+ # Logs to RAM
rm -R $G_FP_DIETPI_USERDATA/radarr/logs* &> /dev/null
mkdir -p /var/log/radarr
ln -sf /var/log/radarr $G_FP_DIETPI_USERDATA/radarr/logs
@@ -11841,6 +11423,9 @@ _EOF_
ln -sf /var/log/radarr/logs.db-shm $G_FP_DIETPI_USERDATA/radarr/logs.db-shm
ln -sf /var/log/radarr/logs.db-wal $G_FP_DIETPI_USERDATA/radarr/logs.db-wal
+ # Permissions
+ chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr /opt/Radarr /var/log/radarr
+
fi
software_id=106 # Lidarr
@@ -11848,7 +11433,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd lidarr &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d $G_FP_DIETPI_USERDATA/lidarr -s $(command -v nologin) lidarr
@@ -11876,6 +11461,9 @@ _EOF_
ln -sf /var/log/lidarr/logs.db-shm $G_FP_DIETPI_USERDATA/lidarr/logs.db-shm
ln -sf /var/log/lidarr/logs.db-wal $G_FP_DIETPI_USERDATA/lidarr/logs.db-wal
+ # Permissions
+ chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr /opt/Lidarr /var/log/lidarr
+
fi
software_id=146 # PlexPy
@@ -11884,13 +11472,12 @@ _EOF_
Banner_Configuration
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd plexpy &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -d /opt/plexpy -s $(command -v nologin) plexpy
# Directory
mkdir -p $G_FP_DIETPI_USERDATA/plexpy
- chown plexpy:dietpi /opt/plexpy $G_FP_DIETPI_USERDATA/plexpy
# Service
cat << _EOF_ > /etc/systemd/system/plexpy.service
@@ -11908,6 +11495,10 @@ ExecStart=/opt/plexpy/PlexPy.py --quiet --daemon --nolaunch --config /opt/plexpy
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R plexpy:plexpy /opt/plexpy
+ chown -R plexpy:dietpi $G_FP_DIETPI_USERDATA/plexpy
+
fi
software_id=147 # Jackett
@@ -11916,7 +11507,7 @@ _EOF_
Banner_Configuration
# User
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd jackett &> /dev/null && usercmd='usermod'
$usercmd -d /opt/jackett -s $(command -v nologin) jackett
@@ -11947,18 +11538,9 @@ ReadWritePaths=/opt/jackett
[Install]
WantedBy=multi-user.target
_EOF_
-
# - Non-ARMv6 devices run the standalone version: https://github.com/Jackett/Jackett#install-on-linux-amdx64
(( $G_HW_ARCH != 1 )) && G_CONFIG_INJECT 'ExecStart=' 'ExecStart=/opt/jackett/jackett --NoRestart' /etc/systemd/system/jackett.service
- # - Jessie: ProtectSystem=strict and ReadWritePaths not supported, use ProtectSystem=full instead: https://manpages.debian.org/jessie/systemd/systemd.exec.5.en.html
- if (( $G_DISTRO < 4 )); then
-
- G_CONFIG_INJECT 'ProtectSystem=' 'ProtectSystem=full' /etc/systemd/system/jackett.service
- sed -i '/^ReadWritePaths=/d' /etc/systemd/system/jackett.service
-
- fi
-
fi
software_id=149 # NZBget
@@ -11966,7 +11548,7 @@ _EOF_
Banner_Configuration
- local usercmd='useradd -rM'
+ local usercmd='useradd -rMU'
getent passwd nzbget &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi -s $(command -v nologin) nzbget
@@ -11982,7 +11564,7 @@ _EOF_
# - Umask: https://github.com/MichaIng/DietPi/issues/1999
sed -i "/UMask=/c\UMask=0002" $G_FP_DIETPI_USERDATA/nzbget/nzbget.conf
- # Optimizations
+ # - Optimizations
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
@@ -12011,6 +11593,9 @@ ExecStart=$G_FP_DIETPI_USERDATA/nzbget/nzbget -D
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R nzbget:dietpi $G_FP_DIETPI_USERDATA/nzbget
+
fi
software_id=155 # HTPC Manager
@@ -12068,6 +11653,9 @@ ExecStart=$G_FP_DIETPI_USERDATA/roonserver/start.sh
WantedBy=multi-user.target
_EOF_
+ # Permissions
+ chown -R roon:dietpi $G_FP_DIETPI_USERDATA/roonserver
+
fi
software_id=156 # Steam
@@ -12143,7 +11731,7 @@ _EOF_
# Move docker containers to dietpi_userdata
mkdir -p $G_FP_DIETPI_USERDATA/docker-data
- if [[ -f /etc/docker/daemon.json ]]; then
+ if [[ -f '/etc/docker/daemon.json' ]]; then
GCI_PRESERVE=1 G_CONFIG_INJECT '"data-root":' " \"data-root\": \"$G_FP_DIETPI_USERDATA/docker-data\"," /etc/docker/daemon.json '^\{([[:space:]]\|$)'
@@ -12163,27 +11751,22 @@ _EOF_
# Setup Filestore DietPi appropriate
# IF already present just create symlink
- if [[ ! -f $G_FP_DIETPI_USERDATA/fuguhub-data/ ]]; then
-
- # Move installed filestore to dietpi folder
- 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 $G_FP_DIETPI_USERDATA/fuguhub-data /home/bd/disk
- # Set permissions
- # setfacl -R -m u:bd:rwx $G_FP_DIETPI_USERDATA/fuguhub-data/
+ if [[ ! -d $G_FP_DIETPI_USERDATA/fuguhub-data/ ]]; then
- else
-
- # Removed 'actual' folder to make way for symlink
- rm -r /home/bd/disk
- # Create symlink
- ln -s $G_FP_DIETPI_USERDATA/fuguhub-data /home/bd/disk
+ # Move installed filestore to dietpi userdata
+ mkdir $G_FP_DIETPI_USERDATA/fuguhub-data
+ mv /home/bd/disk/* $G_FP_DIETPI_USERDATA/fuguhub-data/
+ # Set permissions
+ chown -R bd:bd $G_FP_DIETPI_USERDATA/fuguhub-data/
+ #setfacl -R -m u:bd:rwx $G_FP_DIETPI_USERDATA/fuguhub-data/
fi
+ # Removed 'actual' folder to make way for symlink
+ rm -Rf /home/bd/disk
+ # Create symlink
+ ln -s $G_FP_DIETPI_USERDATA/fuguhub-data /home/bd/disk
+
fi
software_id=164 # Nukkit
@@ -12245,8 +11828,10 @@ _EOF_
Banner_Configuration
# Create allo user for GUI
- useradd -m allo -s /bin/bash -G www-data
- chpasswd <<< 'allo:allo'
+ local usercmd='useradd -mU'
+ getent passwd allo &> /dev/null && usercmd='usermod -a'
+ $usercmd -G www-data -p 'allo' -s /bin/bash allo
+ # - Grant sudo permissions
echo 'allo ALL=NOPASSWD: ALL' > /etc/sudoers.d/allo
# Always Drop DB, and, recreate it, due to error issue with reinstall over the top.
@@ -12255,7 +11840,7 @@ _EOF_
/DietPi/dietpi/func/create_mysql_db allo_db allo_db "$GLOBAL_PW"
mysql allo_db < /var/www/allo_db.sql
- [[ -f /var/www/allo_db.sql ]] && rm /var/www/allo_db.sql
+ [[ -f '/var/www/allo_db.sql' ]] && rm /var/www/allo_db.sql
# Redirect to web interface by default:
rm -f /var/www/index.htm*
@@ -12292,20 +11877,20 @@ _EOF_
cat << _EOF_ > /usr/local/bin/sparky_eth_controller.sh
#!/bin/bash
-#We need to wait until USB eth is established on USB bus. This takes much longer than onboard init and network.target network-pre.target
+# We need to wait until USB eth is established on USB bus. This takes much longer than onboard init and network.target network-pre.target
sleep 20
# - Set USB ETH if found
-if ip a | grep -qi 'eth1'; then
+if ip a s eth1 &> /dev/null; then
echo 'blacklist ethernet' > /etc/modprobe.d/disable_sparkysbc_ethernet.conf
- rm -f /etc/udev/rules.d/70-persist{a,e}nt-net.rules
+ rm -f /etc/udev/rules.d/70-persist{e,a}nt-net.rules
reboot
# - Enable onboard ETH if no adapter found
-elif ! ip a | grep -qi 'eth0'; then
+elif ! ip a s eth0 &> /dev/null; then
[[ -f '/etc/modprobe.d/disable_sparkysbc_ethernet.conf' ]] && rm /etc/modprobe.d/disable_sparkysbc_ethernet.conf
- rm -f /etc/udev/rules.d/70-persist{a,e}nt-net.rules
+ rm -f /etc/udev/rules.d/70-persist{e,a}nt-net.rules
reboot
fi
@@ -12325,17 +11910,22 @@ _EOF_
Banner_Configuration
# Create/Edit user
- local usercmd='useradd -rm'
+ local usercmd='useradd -rMU'
getent passwd gmrender &> /dev/null && usercmd='usermod -a'
$usercmd -G dietpi,audio -s $(command -v nologin) gmrender
# - Add to new "render" group on Buster
- (( $G_DISTRO > 4 )) && usermod -a -G render gmrender
+ (( $G_DISTRO > 4 )) && usermod -aG render gmrender
- # Pre-create log file
+ # Home dir (failsafe)
+ mkdir -p /home/gmrender
+
+ # Log file
>> /var/log/gmrender.log
- chown gmrender:dietpi /var/log/gmrender.log
- # Create systemd unit
+ # Permissions
+ chown -R gmrender:dietpi /home/gmrender /var/log/gmrender.log
+
+ # Service
cat << _EOF_ > /etc/systemd/system/gmrender.service
[Unit]
Description=GMediaRender (DietPi)
@@ -12627,7 +12217,6 @@ _EOF_
Uninstall_Software(){
# NB: systemctl daemon-reload is executed at the end of this function
-
local software_id=-1
software_id=23
@@ -12716,6 +12305,7 @@ _EOF_
Banner_Uninstalling
G_AGP xrdp
+ [[ -f '/etc/apt/preferences.d/dietpi-xrdp' ]] && rm /etc/apt/preferences.d/dietpi-xrdp
fi
@@ -12749,14 +12339,14 @@ _EOF_
# - Find datadir for backups
local datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" /var/www/owncloud/config/config.php | mawk '{print $3}' | sed "s/[',]//g")
[[ $datadir ]] || datadir=$G_FP_DIETPI_USERDATA/owncloud_data
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysql -e "drop user $dbuser@$dbhost"
mysql -e "drop user $dbuser" 2> /dev/null
# - Perform database backup if existent, otherwise skip to not overwrite existing one
[[ -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
+ cp -a /var/www/owncloud/. $datadir/dietpi-owncloud-installation-backup/
# Remove ownCloud installation folder
rm -R /var/www/owncloud
# Remove redirect configs
@@ -12785,7 +12375,7 @@ _EOF_
G_AGP coturn
[[ -f '/etc/turnserver.conf' ]] && rm /etc/turnserver.conf
[[ -d '/etc/systemd/system/coturn.service.d' ]] && rm -R /etc/systemd/system/coturn.service.d
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
systemctl start redis-server
ncc maintenance:mode --off
ncc app:disable spreed
@@ -12814,14 +12404,14 @@ _EOF_
# - Find datadir for backups
local datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" /var/www/nextcloud/config/config.php | mawk '{print $3}' | sed "s/[',]//g")
[[ $datadir ]] || datadir=$G_FP_DIETPI_USERDATA/nextcloud_data
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysql -e "drop user $dbuser@$dbhost"
mysql -e "drop user $dbuser" 2> /dev/null
# - Perform database backup if existent, otherwise skip to not overwrite existing one
[[ -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
+ cp -a /var/www/nextcloud/. $datadir/dietpi-nextcloud-installation-backup/
# Remove Nextcloud installation folder
rm -R /var/www/nextcloud
# Remove redirect configs
@@ -12863,10 +12453,10 @@ _EOF_
Banner_Uninstalling
G_AGP lighttpd
- # Remove certbot renewal hook:
- rm /etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf &> /dev/null
- # Remove hook directory only, if empty:
- rmdir /etc/systemd/system/certbot.service.d &> /dev/null
+ # Remove certbot renewal hook
+ [[ -f 'etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf' ]] && rm /etc/systemd/system/certbot.service.d/dietpi-lighttpd.conf
+ # Remove hook directory if empty
+ rmdir --ignore-fail-on-non-empty /etc/systemd/system/certbot.service.d
fi
@@ -12912,7 +12502,7 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop phpmyadmin -f
mysql -e "drop user 'phpmyadmin'@'localhost'"
G_AGP phpmyadmin
@@ -12923,7 +12513,7 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop phpbb3 -f
mysql -e "drop user 'phpbb3'@'localhost'"
[[ -d '/var/www/phpBB3' ]] && rm -R /var/www/phpBB3
@@ -12931,12 +12521,18 @@ _EOF_
fi
- software_id=115
+ software_id=115 # Webmin
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
+ if [[ -f '/etc/systemd/system/webmin.service' ]]; then
+
+ systemctl disable --now webmin
+ rm /etc/systemd/system/webmin.service
+
+ fi
G_AGP webmin
- rm /etc/systemd/system/webmin.service
+ [[ -f '/etc/apt/sources.list.d/webmin.list' ]] && rm /etc/apt/sources.list.d/webmin.list
fi
@@ -12960,14 +12556,13 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
#apt-mark auto libmpdclient2 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev
- if [[ -f '/usr/lib/systemd/system/mympd.service' ]]; then
+ if [[ -f '/lib/systemd/system/mympd.service' ]]; then
systemctl unmask mympd
- systemctl disable mympd
- rm /usr/lib/systemd/system/mympd.service
+ systemctl disable --now mympd
+ rm /lib/systemd/system/mympd.service
fi
- [[ -d '/etc/systemd/system/mympd.service.d' ]] && rm -R /etc/systemd/system/mympd.service.d
getent passwd mympd &> /dev/null && userdel -rf mympd
command -v mympd &> /dev/null && rm $(command -v mympd)
rm -Rf /{etc,var/lib,usr/share}/mympd
@@ -13062,7 +12657,7 @@ _EOF_
rm /etc/lighttpd/conf-available/99-dietpi-ompd.conf
fi
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop ompd -f
mysql -e 'drop user ompd@localhost'
@@ -13086,7 +12681,7 @@ _EOF_
rm /etc/systemd/system/blynkserver.service
fi
- userdel -rf blynk
+ getent passwd blynk &> /dev/null && userdel -rf blynk
[[ -d $G_FP_DIETPI_USERDATA/blynk ]] && rm -R $G_FP_DIETPI_USERDATA/blynk
[[ -d '/etc/blynkserver' ]] && rm -R /etc/blynkserver # Pre-v6.19
@@ -13096,12 +12691,18 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- rm /etc/systemd/system/aria2.service
- rm /usr/local/bin/aria2c
- rm /var/lib/dietpi/dietpi-software/installed/aria2.conf
- rm -R /var/www/aria2
+ [[ -d '/var/www/aria2' ]] && rm -R /var/www/aria2
+ if [[ -f '/etc/systemd/system/aria2.service' ]]; then
+
+ systemctl disable --now aria2
+ rm /etc/systemd/system/aria2.service
+ fi
G_AGP aria2
+ getent passwd aria2 &> /dev/null && userdel -rf aria2
+ [[ -d $G_FP_DIETPI_USERDATA/aria2 ]] && rm -R $G_FP_DIETPI_USERDATA/aria2
+ [[ -f $G_FP_DIETPI_USERDATA/downloads/aria2.session ]] && rm $G_FP_DIETPI_USERDATA/downloads/aria2.session
+ [[ -f '/usr/local/bin/aria2c' ]] && rm /usr/local/bin/aria2c # Previous
fi
@@ -13132,11 +12733,15 @@ _EOF_
Banner_Uninstalling
#apt-mark auto libjpeg8 libpng12-0 libfontconfig1 libssl1.0.0 &> /dev/null
- rm /etc/systemd/system/tonido.service
- rm -R $G_FP_DIETPI_USERDATA/tonido
+ if [[ -f '/etc/systemd/system/tonido.service' ]]; then
+
+ systemctl disable --now tonido
+ rm /etc/systemd/system/tonido.service
- userdel -rf tonido
- rm -R /home/tonido
+ fi
+ getent passwd tonido &> /dev/null && userdel -rf tonido
+ [[ -d $G_FP_DIETPI_USERDATA/tonido ]] && rm -R $G_FP_DIETPI_USERDATA/tonido
+ [[ -d '/home/tonido' ]] && rm -R /home/tonido
fi
@@ -13166,7 +12771,6 @@ _EOF_
Banner_Uninstalling
G_AGP cloudprint-service
- (( $G_DISTRO < 4 )) && rm /etc/apt/sources.list.d/cloudprint.list
fi
@@ -13194,14 +12798,6 @@ _EOF_
fi
- software_id=140
- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
-
- Banner_Uninstalling
- G_AGP libsdl2 libsdl2-image libsdl2-mixer libsdl2-net libsdl2-ttf libsmpeg2
-
- fi
-
software_id=141
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
@@ -13227,16 +12823,20 @@ _EOF_
Banner_Uninstalling
- userdel -rf koel
+ if [[ -f '/etc/systemd/system/koel.service' ]]; then
+
+ systemctl disable --now koel
+ rm /etc/systemd/system/koel.service
+
+ fi
+
+ getent passwd koel &> /dev/null && userdel -rf koel
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop koel -f
mysql -e 'drop user koel@localhost'
- rm -R $G_FP_DIETPI_USERDATA/koel
-
- systemctl disable koel
- rm /etc/systemd/system/koel.service
+ [[ -d $G_FP_DIETPI_USERDATA/koel ]] && rm -R $G_FP_DIETPI_USERDATA/koel
fi
@@ -13388,7 +12988,12 @@ _EOF_
Banner_Uninstalling
[[ -d $G_FP_DIETPI_USERDATA/roonserver ]] && rm -R $G_FP_DIETPI_USERDATA/roonserver
- [[ -f '/etc/systemd/system/roonserver.service' ]] && rm /etc/systemd/system/roonserver.service
+ if [[ -f '/etc/systemd/system/roonserver.service' ]]; then
+
+ systemctl disable --now roonserver
+ rm /etc/systemd/system/roonserver.service
+
+ fi
fi
@@ -13430,10 +13035,10 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
+ #apt-mark auto libcec4 libcurl3-gnutls libnfs*
G_AGP kodi kodi-odroid
[[ -f '/usr/share/applications/kodi.desktop' ]] && rm /usr/share/applications/kodi.desktop
- [[ -f '/root/Desktop/kodi.desktop' ]] && rm /root/Desktop/kodi.desktop
- rm -f /home/*/Desktop/kodi.desktop
+ rm -f /{root,home/*}/Desktop/kodi.desktop
[[ -f '/etc/udev/rules.d/99-dietpi-kodi.rules' ]] && rm /etc/udev/rules.d/99-dietpi-kodi.rules
fi
@@ -13555,26 +13160,48 @@ _EOF_
Banner_Uninstalling
pihole uninstall
- # - pihole-FTL service+binary
- systemctl disable pihole-FTL &> /dev/null
- systemctl stop pihole-FTL &> /dev/null
- rm /etc/init.d/pihole-FTL &> /dev/null
- rm /usr/bin/pihole-FTL &> /dev/null
+ # pihole-FTL service+binary
+ if [[ -f '/etc/init.d/pihole-FTL' ]]; then
+
+ systemctl unmask pihole-FTL
+ systemctl disable --now pihole-FTL
+ rm /etc/init.d/pihole-FTL
+
+ fi
+ [[ -f '/usr/bin/pihole-FTL' ]] && rm /usr/bin/pihole-FTL
- rm -R /etc/pihole &> /dev/null
- rm -R /etc/.pihole &> /dev/null
- rm -R /opt/pihole &> /dev/null
- rm -R /var/www/html/admin &> /dev/null
- rm -R /var/www/html/pihole &> /dev/null
+ # Dirs
+ [[ -d '/etc/pihole' ]] && rm -R /etc/pihole
+ [[ -d '/etc/.pihole' ]] && rm -R /etc/.pihole
+ [[ -d '/opt/pihole' ]] && rm -R /opt/pihole
+ [[ -d '/var/www/html/admin' ]] && rm -R /var/www/html/admin
+ [[ -d '/var/www/html/pihole' ]] && rm -R /var/www/html/pihole
- # - symlinks
- rm /var/www/pihole &> /dev/null
- rm /var/www/admin &> /dev/null
- [[ $(readlink /var/www/index.php) == 'pihole/index.php' ]] && rm /var/www/index.php
+ # Symlinks
+ [[ -L '/var/www/pihole' ]] && rm /var/www/pihole
+ [[ -L '/var/www/admin' ]] && rm /var/www/admin
- # - pre Pi-hole v4
+ # Pre Pi-hole v4
G_AGP dnsmasq
- rm -R /etc/dnsmasq* &> /dev/null
+ rm -Rf /etc/dnsmasq*
+
+ # Disable and remove webserver configs
+ # - Apache
+ if [[ -d '/etc/apache2/sites-available' ]]; then
+
+ a2dissite dietpi-pihole* 2> /dev/null
+ rm -f /etc/apache2/sites-available/dietpi-pihole*
+
+ fi
+ # - Lighttpd
+ if [[ -d '/etc/lighttpd/mods-available' ]]; then
+
+ lighttpd-disable-mod dietpi-pihole* 2> /dev/null
+ rm -f /etc/lighttpd/mods-available/dietpi-pihole*
+
+ fi
+ # - Nginx
+ [[ -d '/etc/nginx/sites-dietpi' ]] && rm -f /etc/nginx/sites-dietpi/dietpi-pihole*
fi
@@ -13664,7 +13291,7 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop wordpress -f
mysql -e "drop user 'wordpress'@'localhost'"
@@ -13682,7 +13309,7 @@ _EOF_
a2disconf dietpi-freshrss &> /dev/null
rm /etc/apache2/conf-available/dietpi-freshrss.conf &> /dev/null
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop freshrss -f
mysql -e "drop user 'freshrss'@'localhost'"
@@ -13692,22 +13319,26 @@ _EOF_
fi
- software_id=27
- if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )) ||
- (( ${aSOFTWARE_INSTALL_STATE[28]} == -1 )) ||
- (( ${aSOFTWARE_INSTALL_STATE[120]} == -1 )); then
+ # TigerVNC/RealVNC
+ if (( ${aSOFTWARE_INSTALL_STATE[28]} == -1 || ${aSOFTWARE_INSTALL_STATE[120]} == -1 )); then
+ (( ${aSOFTWARE_INSTALL_STATE[28]} == -1 )) && software_id=28 || software_id=120
Banner_Uninstalling
- G_AGP tightvncserver tigervnc-* vnc4server x11vnc realvnc-vnc-server
+ G_AGP tigervnc-* x11vnc realvnc-vnc-server
- rm /etc/systemd/system/vncserver.service
- rm /etc/init.d/vncserver
- rm /usr/local/bin/vncserver
- rm -R /root/.vnc
+ if [[ -f '/etc/systemd/system/vncserver.service' ]]; then
+
+ systemctl disable --now vncserver
+ rm -R /etc/systemd/system/vncserver.service*
+
+ fi
+ [[ -f '/etc/init.d/vncserver' ]] && rm /etc/init.d/vncserver
+ [[ -f '/usr/local/bin/vncserver' ]] && rm /usr/local/bin/vncserver
+ [[ -d '/root/.vnc' ]] && rm -R /root/.vnc
# + RealVNC services
- systemctl disable vncserver-x11-serviced.service
- systemctl disable vncserver-virtuald.service
+ systemctl disable vncserver-x11-serviced.service 2> /dev/null
+ systemctl disable vncserver-virtuald.service 2> /dev/null
fi
@@ -13745,7 +13376,7 @@ _EOF_
[[ -d '/var/www/ampache' ]] && rm -R /var/www/ampache
# Drop database
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop ampache -f
mysql -e 'drop user ampache@localhost'
@@ -13761,7 +13392,7 @@ _EOF_
fi
- software_id=97 # OpenVPN server
+ software_id=97 # OpenVPN Server
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
@@ -13779,6 +13410,7 @@ _EOF_
[[ -d '/etc/wireguard' ]] && rm -R /etc/wireguard
[[ -f '/etc/apt/sources.list.d/dietpi-wireguard.list' ]] && rm /etc/apt/sources.list.d/dietpi-wireguard.list
[[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]] && rm /etc/apt/preferences.d/dietpi-wireguard
+ [[ -f '/etc/kernel/postinst.d/dietpi-wireguard' ]] && rm /etc/kernel/postinst.d/dietpi-wireguard
fi
@@ -13795,21 +13427,9 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- if (( $G_DISTRO > 3 )); then
-
- G_AGP python-certbot-apache python-certbot-nginx certbot
- [[ -f '/etc/systemd/system/certbot.service' ]] && rm /etc/systemd/system/certbot.service
- [[ -d '/etc/systemd/system/certbot.service.d' ]] && rm -R /etc/systemd/system/certbot.service.d
-
- else
-
- # Pre-reqs: https://github.com/certbot/certbot/blob/master/certbot-auto#L390-L399
- #apt-mark auto python python-dev virtualenv python-virtualenv gcc libaugeas0 augeas-lenses libssl-dev openssl libffi-dev ca-certificates
- [[ -d '/etc/certbot_scripts' ]] && rm -R /etc/certbot_scripts
- [[ -f '/etc/cron.weekly/dietpi-letsencrypt' ]] && rm /etc/cron.weekly/dietpi-letsencrypt
- [[ -f '/home/minio-user/.minio/dietpi-cert-renewl.sh' ]] && rm /home/minio-user/.minio/dietpi-cert-renewl.sh
-
- fi
+ G_AGP python3-certbot-apache python3-certbot-nginx certbot
+ [[ -f '/etc/systemd/system/certbot.service' ]] && rm /etc/systemd/system/certbot.service
+ [[ -d '/etc/systemd/system/certbot.service.d' ]] && rm -R /etc/systemd/system/certbot.service.d
fi
@@ -13849,35 +13469,32 @@ _EOF_
fi
- software_id=60
+ software_id=60 # WiFi Hotspot
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- #apt-mark auto libssl1.0.0 &> /dev/null
+ #apt-mark auto libnl-3-200 libssl1.0.0 &> /dev/null
G_AGP hostapd isc-dhcp-server
- rm /etc/dhcp/dhcpd.conf &> /dev/null
- rm /etc/hostapd/hostapd.conf &> /dev/null
- rm /etc/default/isc-dhcp-server &> /dev/null
- rm /etc/default/hostapd &> /dev/null
- rm /etc/iptables.ipv4.nat &> /dev/null
- # - remove binary (used a -f trigger to detect wifi hotspot mode in dietpi-config).
- rm /usr/sbin/hostapd &> /dev/null
- rm /usr/sbin/hostapd_cli &> /dev/null
+ [[ -f '/etc/dhcp/dhcpd.conf' ]] && rm /etc/dhcp/dhcpd.conf
+ [[ -f '/etc/hostapd/hostapd.conf' ]] && rm /etc/hostapd/hostapd.conf
+ [[ -f '/etc/default/isc-dhcp-server' ]] && rm /etc/default/isc-dhcp-server
+ [[ -f '/etc/etc/default/hostapd' ]] && rm /etc/default/hostapd
+ [[ -f '/etc/iptables.ipv4.nat' ]] && rm /etc/iptables.ipv4.nat
+ # Remove binary (used a -f trigger to detect wifi hotspot mode in dietpi-config).
+ [[ -f '/usr/sbin/hostapd' ]] && rm /usr/sbin/hostapd
+ [[ -f '/usr/sbin/hostapd_cli' ]] && rm /usr/sbin/hostapd_cli
# IP forwarding
- [[ -f /etc/sysctl.d/dietpi-wifihotspot.conf ]] && rm /etc/sysctl.d/dietpi-wifihotspot.conf
+ [[ -f '/etc/sysctl.d/dietpi-wifihotspot.conf' ]] && rm /etc/sysctl.d/dietpi-wifihotspot.conf
- #Set Wlan back to inactive and ready for use with dietpi-config.
- local wifi_index=$(sed -n 2p /DietPi/dietpi/.network)
-
- # - Remove all entries below wlan, so we can recreate them.
+ # Set WiFi interface back to inactive and ready for use with dietpi-config.
+ local wifi_index=$(mawk 'NR==2 {print}' /DietPi/dietpi/.network)
+ # - Remove all entries below wlan, so we can recreate them
sed -i '/allow-hotplug wlan/q0' /etc/network/interfaces
-
- # - Disable wlan
+ # - Disable
sed -i "/allow-hotplug wlan/c\#allow-hotplug wlan$wifi_index" /etc/network/interfaces
-
- # - Add default wifi settings to network interfaces config
+ # - Add default WiFi settings to network interfaces config
cat << _EOF_ >> /etc/network/interfaces
iface wlan$wifi_index inet dhcp
address 192.168.0.101
@@ -13887,11 +13504,9 @@ wireless-power off
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#dns-nameservers 8.8.8.8 8.8.4.4
_EOF_
-
# - Flush IP tables
iptables -F
iptables -t nat -F
- iptables-save > /etc/iptables.ipv4.nat
fi
@@ -13922,7 +13537,7 @@ _EOF_
[[ -f '/etc/lighttpd/conf-available/99-dietpi-pydio.conf' ]] && rm /etc/lighttpd/conf-available/99-dietpi-pydio.conf
# Drop database
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop pydio -f
mysql -e "drop user pydio@localhost"
@@ -13964,7 +13579,7 @@ _EOF_
rm -R /var/www/baikal
#drop database
- systemctl start $MARIADB_SERVICE
+ systemctl start mariadb
mysqladmin drop baikal -f
mysql -e "drop user 'baikal'@'localhost'"
@@ -13988,7 +13603,7 @@ _EOF_
# 1.2.0+
G_AGP netdata
- # Pre v6.22 || Raspbian Stretch + All Jessie
+ # Pre-v6.22 Raspbian Stretch + Pre-v6.26 Raspbian Stretch ARMv6 only
[[ -f '/etc/systemd/system/netdata.service' ]] && rm /etc/systemd/system/netdata.service
getent passwd netdata &> /dev/null && userdel netdata
@@ -14018,13 +13633,8 @@ _EOF_
Banner_Uninstalling
G_AGP emby-server embymagick
- # - Pre v6.15
- if [[ -f '/etc/apt/sources.list.d/emby-server.list' ]]; then
-
- rm /etc/apt/sources.list.d/emby-server.list
- G_AGUP
-
- fi
+ # Pre v6.15
+ [[ -f '/etc/apt/sources.list.d/emby-server.list' ]] && rm /etc/apt/sources.list.d/emby-server.list
fi
@@ -14052,11 +13662,15 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- rm -R /etc/cuberite &> /dev/null # pre v6.11
- rm -R $G_FP_DIETPI_USERDATA/cubrite
- rm /etc/systemd/system/cuberite.service
+ if [[ -f '/etc/systemd/system/cuberite.service' ]]; then
- userdel -rf cuberite
+ systemctl disable --now cuberite
+ rm /etc/systemd/system/cuberite.service
+
+ fi
+ getent passwd cuberite &> /dev/null && userdel -rf cuberite
+ [[ -f '/etc/cuberite' ]] && rm -R /etc/cuberite # pre v6.11
+ [[ -d $G_FP_DIETPI_USERDATA/cubrite ]] && rm -R $G_FP_DIETPI_USERDATA/cubrite
fi
@@ -14081,15 +13695,21 @@ _EOF_
Banner_Uninstalling
- userdel -rf gogs
+ if [[ -f '/etc/systemd/system/gogs.service' ]]; then
- rm -R /etc/gogs
- rm /etc/systemd/system/gogs.service
- rm -R /var/log/gogs
+ systemctl disable --now gogs
+ rm -R /etc/systemd/system/gogs.service*
- systemctl start $MARIADB_SERVICE
+ fi
+
+ getent passwd gogs &> /dev/null && userdel -rf gogs
+
+ [[ -d '/etc/gogs' ]] && rm -R /etc/gogs
+ [[ -d '/var/log/gogs' ]] && rm -R /var/log/gogs
+
+ systemctl start mariadb
mysqladmin drop gogs -f
- mysql -e "drop user 'gogs'@'localhost'"
+ mysql -e 'drop user gogs@localhost'
fi
@@ -14155,31 +13775,36 @@ _EOF_
fi
- # - Webserver rutorrent user/pw settings
+ # Webserver rutorrent user/pw settings
[[ -f '/etc/.rutorrent-htaccess' ]] && rm /etc/.rutorrent-htaccess
-
- # Lighttpd
+ # - Lighttpd
#Remove from
#RUTORRENT_DIETPI to #RUTORRENT_DIETPI in /etc/lighttpd/lighttpd.conf
-
- # Nginx
+ # - Nginx
[[ -f '/etc/nginx/sites-dietpi/dietpi-rutorrent.conf' ]] && rm /etc/nginx/sites-dietpi/dietpi-rutorrent.conf
-
- # Apache2
+ # - Apache2
command -v a2dissite &> /dev/null && a2dissite dietpi-rutorrent
[[ -f '/etc/apache2/sites-available/dietpi-rutorrent.conf' ]] && rm /etc/apache2/sites-available/dietpi-rutorrent.conf
fi
- software_id=108
+ software_id=108 # Amiberry
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- rm -R $G_FP_DIETPI_USERDATA/amiberry
- rm /etc/systemd/system/amiberry.service
+ # Service
+ if [[ -f '/etc/systemd/system/amiberry.service' ]]; then
- # Disable autostart, revert boot index to console
- /DietPi/dietpi/dietpi-autostart 0
+ systemctl disable --now amiberry
+ rm /etc/systemd/system/amiberry.service
+
+ fi
+ # Files
+ [[ -d $G_FP_DIETPI_USERDATA/amiberry ]] && rm -R $G_FP_DIETPI_USERDATA/amiberry
+ # Autostart index: If currently Amiberry, revert to console login
+ [[ -f '/DietPi/dietpi/.dietpi-autostart_index' && $( $G_FP_DIETPI_USERDATA/mariadb-database-backup.sql
- # On Jessie, purging MariaDB server with unix_socket authentication fails, thus revert to password:
- (( $G_DISTRO < 4 )) && mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by '$GLOBAL_PW' with grant option;flush privileges"
- systemctl stop $MARIADB_SERVICE
+ systemctl stop mariadb
G_AGP mariadb-server php*-mysql
# - config folder
@@ -14446,12 +14065,18 @@ _EOF_
Banner_Uninstalling
G_AGP influxdb
- rm /etc/apt/sources.list.d/influxdb.list
- rm -R /var/lib/influxdb
- rm -R $G_FP_DIETPI_USERDATA/influxdb
+ if [[ -f '/lib/systemd/system/influxdb.service' ]]; then
+
+ systemctl unmask influxdb
+ systemctl disable --now influxdb
+ rm /lib/systemd/system/influxdb.service
+
+ fi
- rm /lib/systemd/system/influxdb.service &> /dev/null # still exists after G_AGP
+ [[ -f '/etc/apt/sources.list.d/influxdb.list' ]] && rm /etc/apt/sources.list.d/influxdb.list
+ rm -Rf /var/lib/influxdb # Symlink
+ [[ -d $G_FP_DIETPI_USERDATA/influxdb ]] && rm -R $G_FP_DIETPI_USERDATA/influxdb
fi
@@ -14473,10 +14098,14 @@ _EOF_
Banner_Uninstalling
- rm /etc/systemd/system/ubooquity.service
- rm -R $G_FP_DIETPI_USERDATA/ubooquity
+ if [[ -f '/etc/systemd/system/ubooquity.service' ]]; then
+
+ systemctl disable --now ubooquity
+ rm /etc/systemd/system/ubooquity.service
+ fi
userdel -rf ubooquity
+ [[ -d $G_FP_DIETPI_USERDATA/ubooquity ]] && rm -R $G_FP_DIETPI_USERDATA/ubooquity
fi
@@ -14675,8 +14304,8 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- #apt-mark auto xserver-xorg-video-armsoc libdrm-rockchip1 libmali-rk-utgard-450-r7p0 aml-libs-odroid mali450-odroid xf86-video-mali-odroid libump* xf86-video-fbturbo* firmware-samsung xf86-video-armsoc-odroid malit628-odroid &> /dev/null
- G_AGP xserver-xorg xinit xcompmgr xterm dbus-x11 xfonts-base x11-xserver-utils x11-utils
+ apt-mark auto dbus-x11 libgl1-mesa-dri mesa-* libdrm-rockchip1 libmali-rk-utgard-450-r7p0 xf86-video-* malit628-odroid mali450-odroid aml-libs-odroid libump* firmware-samsung &> /dev/null
+ G_AGP xorg* xserver-xorg* x11-* xinit xcompmgr xterm xfonts-base
rm /etc/xdg/autostart/xcompmgr.desktop /etc/X11/xorg.conf /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf &> /dev/null
fi
@@ -14701,10 +14330,7 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then
Banner_Uninstalling
- G_AGP dropbear* # Stretch: dropbear-initramfs dropbear-run
-
- # Required on Jessie only, since ECDSA key is not created on install automatically, thus not removed on uninstall
- [[ -d '/etc/dropbear' ]] && rm -R /etc/dropbear
+ G_AGP dropbear*
fi
@@ -14783,7 +14409,7 @@ _EOF_
npm r -g n yarn npm
G_AGP nodejs
- # - old install via repo
+ # Old install via repo
[[ -f '/etc/apt/sources.list.d/nodesource_nodejs.list' ]] && rm /etc/apt/sources.list.d/nodesource_nodejs.list
[[ -f '/usr/local/bin/node' ]] && rm /usr/local/bin/node
@@ -14811,7 +14437,7 @@ _EOF_
fi
- software_id=170
+ software_id=170 # UnRAR
if (( aSOFTWARE_INSTALL_STATE[$software_id] == -1 )); then
Banner_Uninstalling
@@ -14835,14 +14461,14 @@ _EOF_
# Check if we need to clear DietPi choices
local fp_temp='.dietpi-uninstall_dpkg'
dpkg --get-selections | mawk '{print $1}' > $fp_temp
- if ! grep -q '^openssh-server' $fp_temp && ! grep -q '^dropbear' $fp_temp; then
+ if ! grep -qE '^(openssh-server|dropbear)' $fp_temp; then
INDEX_SSHSERVER_CURRENT=0
INDEX_SSHSERVER_TARGET=0
fi
- if ! grep -q '^samba$' $fp_temp && ! grep -q '^proftpd-basic' $fp_temp; then
+ if ! grep -qE '^(samba$|proftpd-basic)' $fp_temp; then
INDEX_FILESERVER_CURRENT=0
INDEX_FILESERVER_TARGET=0
@@ -14889,25 +14515,16 @@ _EOF_
#------------------------------------------------------------
# Update & upgrade APT
Banner_Apt_Update
-
- # - Update APT list
+ # - Update APT lists
G_AGUP
-
# - Simulated 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'
G_AGI $package_to_test -s
-
# - Upgrade APT packages
G_AGUG
-
- # - Automation Set NTPD mode
- # Due to possible packages required, must be done here after APT cache updated
- if (( $G_DIETPI_INSTALL_STAGE == 1 )); then
-
- /DietPi/dietpi/func/dietpi-set_software ntpd-mode $(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-
- fi
+ # - Full upgrade on first run installs: https://github.com/MichaIng/DietPi/issues/3098
+ (( $G_DIETPI_INSTALL_STAGE == 1 )) && G_AGDUG
# Generate dir for dietpi-software installed "non-service" based control scripts
mkdir -p /var/lib/dietpi/dietpi-software/services
@@ -14942,8 +14559,6 @@ _EOF_
Banner_Configs
Install_Apply_Configs
- /DietPi/dietpi/func/dietpi-set_software setpermissions &> /dev/null
-
# Apply autostart index
local autostart_current=0
[[ -f '/DietPi/dietpi/.dietpi-autostart_index' ]] && autostart_current=$( /dev/null && G_AGP fake-hwclock
- # - x86_64 microcode installation
+ # x86_64 microcode installation
if (( $G_HW_ARCH == 10 )); then
grep -qi 'vendor_id.*intel' /proc/cpuinfo && G_AGI intel-microcode
@@ -14981,20 +14596,20 @@ _EOF_
fi
- # - Custom 1st run Script (Local file)
+ # Custom 1st run Script (Local file)
local run_custom_script=0
if [[ -f '/boot/Automation_Custom_Script.sh' ]]; then
cp /boot/Automation_Custom_Script.sh /root/AUTO_CustomScript.sh
run_custom_script=1
- # - Custom 1st run Script (Online file)
- elif [[ $AUTOINSTALL_CUSTOMSCRIPTURL != '0' ]]; then
+ # Custom 1st run Script (Online file)
+ elif [[ ${AUTOINSTALL_CUSTOMSCRIPTURL:-0} != '0' ]]; then
INSTALL_URL_ADDRESS=$AUTOINSTALL_CUSTOMSCRIPTURL
G_CHECK_URL "$INSTALL_URL_ADDRESS"
- #Get script and execute
+ # Get script and execute
wget "$INSTALL_URL_ADDRESS" -O /root/AUTO_CustomScript.sh
run_custom_script=1
@@ -15034,24 +14649,25 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# First Run / Automation functions Vars (eg: on a fresh install)
#/////////////////////////////////////////////////////////////////////////////////////
- AUTOINSTALL_ENABLED=0
- AUTOINSTALL_SSHINDEX=0
- AUTOINSTALL_FILESERVERINDEX=0
- AUTOINSTALL_LOGGINGINDEX=0
- AUTOINSTALL_WEBSERVERINDEX=0
- AUTOINSTALL_AUTOSTARTTARGET=0
- AUTOINSTALL_CUSTOMSCRIPTURL=0
-
FirstRun_Automation_Init(){
# Get settings
- AUTOINSTALL_ENABLED=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_AUTOMATED=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- AUTOINSTALL_AUTOSTARTTARGET=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_AUTOSTART_TARGET_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//' )
- AUTOINSTALL_SSHINDEX=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_SSH_SERVER_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- AUTOINSTALL_FILESERVERINDEX=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_FILE_SERVER_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- AUTOINSTALL_LOGGINGINDEX=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_LOGGING_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- AUTOINSTALL_WEBSERVERINDEX=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_WEB_SERVER_INDEX=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- AUTOINSTALL_CUSTOMSCRIPTURL=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_CUSTOM_SCRIPT_EXEC=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ AUTOINSTALL_ENABLED=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOMATED=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_AUTOSTARTTARGET=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOSTART_TARGET_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_SSHINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SSH_SERVER_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_FILESERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_FILE_SERVER_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_LOGGINGINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOGGING_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_WEBSERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_WEB_SERVER_INDEX=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_CUSTOMSCRIPTURL=$(sed -n '/^[[:blank:]]*AUTO_SETUP_CUSTOM_SCRIPT_EXEC=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ AUTOINSTALL_TIMESYNCMODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ # Else set defaults
+ [[ $AUTOINSTALL_ENABLED ]] || AUTOINSTALL_ENABLED=0
+ [[ $AUTOINSTALL_AUTOSTARTTARGET ]] || AUTOINSTALL_AUTOSTARTTARGET=0
+ [[ $AUTOINSTALL_SSHINDEX ]] || AUTOINSTALL_SSHINDEX=0
+ [[ $AUTOINSTALL_FILESERVERINDEX ]] || AUTOINSTALL_FILESERVERINDEX=0
+ [[ $AUTOINSTALL_LOGGINGINDEX ]] || AUTOINSTALL_LOGGINGINDEX=0
+ [[ $AUTOINSTALL_WEBSERVERINDEX ]] || AUTOINSTALL_WEBSERVERINDEX=0
+ [[ $AUTOINSTALL_TIMESYNCMODE ]] || AUTOINSTALL_TIMESYNCMODE=2
}
@@ -15062,21 +14678,18 @@ _EOF_
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Running automated installation'
- # Skip dietpi-software menu
- TARGETMENUID=-1
-
- # Set start install
- GOSTARTINSTALL=1
+ TARGETMENUID=-1 # Skip menu loop
+ GOSTARTINSTALL=1 # Set install start flag
# Find all software entries of AUTO_SETUP_INSTALL_SOFTWARE_ID= in dietpi.txt. Then set to state 1 for installation.
while read -r software_id
do
- # - Flag for installation
- if disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$software_id]}"; then
+ # Flag for installation
+ if [[ ${aSOFTWARE_NAME[$software_id]} ]]; then
aSOFTWARE_INSTALL_STATE[$software_id]=1
- G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_WHIP_NAME[$software_id]}. Flagged for installation."
+ G_DIETPI-NOTIFY 2 "Automation: ${aSOFTWARE_NAME[$software_id]}. Flagged for installation."
fi
@@ -15091,7 +14704,10 @@ _EOF_
INDEX_WEBSERVER_TARGET=$AUTOINSTALL_WEBSERVERINDEX
# Re-flag RAMlog for install, if enabled, ensures AUTO_SETUP_RAMLOG_MAXSIZE gets applied
- (( $INDEX_LOGGING_TARGET == -1 || $INDEX_LOGGING_TARGET == -2 )) && aSOFTWARE_INSTALL_STATE[103]=1
+ [[ $INDEX_LOGGING_TARGET == -[12] ]] && aSOFTWARE_INSTALL_STATE[103]=1
+
+ # Set time sync mode
+ /DietPi/dietpi/func/dietpi-set_software ntpd-mode $AUTOINSTALL_TIMESYNCMODE
}
@@ -15100,21 +14716,16 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
Input_Modes(){
- # Skip menu
- TARGETMENUID=-1
-
- DISABLE_REBOOT=1
-
local input=$@
input=${input#*[[:blank:]]}
- # Install software and exit.
+ # Process software and exit
if [[ $1 == 'install' || $1 == 'reinstall' || $1 == 'uninstall' ]]; then
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Automated $1"
# - Make sure we have at least one entry
- if [[ -z $2 ]]; then
+ if [[ -z $input ]]; then
G_DIETPI-NOTIFY 1 'Please enter at least one software index ID or choice system INDEX_*_TARGET=-?'
@@ -15128,7 +14739,7 @@ _EOF_
do
# - Check if input software ID exists, install state was defined
- if disable_error=1 G_CHECK_VALIDINT "$i" 0 &&
+ if disable_error=1 G_CHECK_VALIDINT "$i" 0 &&
disable_error=1 G_CHECK_VALIDINT "${aSOFTWARE_INSTALL_STATE[$i]}"; then
if [[ $1 == 'uninstall' ]]; then
@@ -15136,12 +14747,12 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then
aSOFTWARE_INSTALL_STATE[$i]=-1
- G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}"
+ G_DIETPI-NOTIFY 0 "Uninstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}"
else
- G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed"
- G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}"
+ G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is not currently installed"
+ G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}"
fi
@@ -15149,29 +14760,29 @@ _EOF_
if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for $G_HW_ARCH_DESCRIPTION."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_DESCRIPTION systems."
elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for $G_HW_MODEL_DESCRIPTION."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_DESCRIPTION."
elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for Debian $G_DISTRO_NAME."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}."
elif (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )); then
aSOFTWARE_INSTALL_STATE[$i]=1
- GOSTARTINSTALL=1
+ GOSTARTINSTALL=1 # Set install start flag
- G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}"
+ G_DIETPI-NOTIFY 0 "Reinstalling ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}"
sleep 0.5
else
- G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is not currently installed"
+ G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_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]}"
+ G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}"
fi
@@ -15179,29 +14790,29 @@ _EOF_
if (( ! ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for $G_HW_ARCH_DESCRIPTION."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on $G_HW_ARCH_DESCRIPTION systems."
elif (( ! ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for $G_HW_MODEL_DESCRIPTION."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported for $G_HW_MODEL_DESCRIPTION."
elif (( ! ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )); then
- G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_WHIP_NAME[$i]}) is not supported for Debian $G_DISTRO_NAME."
+ G_DIETPI-NOTIFY 1 "Software title (${aSOFTWARE_NAME[$i]}) is not supported on Debian ${G_DISTRO_NAME^}."
elif (( ${aSOFTWARE_INSTALL_STATE[$i]} != 2 )); then
aSOFTWARE_INSTALL_STATE[$i]=1
- GOSTARTINSTALL=1
+ GOSTARTINSTALL=1 # Set install start flag
- G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}"
+ G_DIETPI-NOTIFY 0 "Installing ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}"
sleep 0.5
else
- G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_WHIP_NAME[$i]} is already installed"
- G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\", to force rerun of installation and configuration scripts for ${aSOFTWARE_WHIP_NAME[$i]}."
- G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_WHIP_NAME[$i]}"
+ G_DIETPI-NOTIFY 2 "$i: ${aSOFTWARE_NAME[$i]} is already installed"
+ G_DIETPI-NOTIFY 2 "Use \"dietpi-software reinstall $i\", to force rerun of installation and configuration scripts for ${aSOFTWARE_NAME[$i]}."
+ G_DIETPI-NOTIFY 0 "No changes applied for: ${aSOFTWARE_NAME[$i]}"
fi
@@ -15220,11 +14831,7 @@ _EOF_
elif [[ $1 == 'uninstall' ]]; then
Uninstall_Software
-
- # - Save
Write_InstallFileList
-
- # - Start services
[[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services start
fi
@@ -15234,13 +14841,13 @@ _EOF_
# List software IDs, names and additional info
elif [[ $1 == 'list' ]]; then
- for i in ${!aSOFTWARE_INSTALL_STATE[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
local string="\e[0mID $i | "
(( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 )) && string="\e[32mID $i | "
- string+="=${aSOFTWARE_INSTALL_STATE[$i]} | ${aSOFTWARE_WHIP_NAME[$i]}:\e[0m \e[90m${aSOFTWARE_WHIP_DESC[$i]}\e[0m |"
+ string+="=${aSOFTWARE_INSTALL_STATE[$i]} | ${aSOFTWARE_NAME[$i]}:\e[0m \e[90m${aSOFTWARE_DESC[$i]}\e[0m |"
(( ${aSOFTWARE_REQUIRES_ALSA[$i]:=0} == 1 )) && string+=' +ALSA'
(( ${aSOFTWARE_REQUIRES_XSERVERXORG[$i]:=0} == 1 )) && string+=' +XSERVER'
@@ -15285,11 +14892,11 @@ _EOF_
# Get highest software array index
local max=0
- for max in ${!aSOFTWARE_INSTALL_STATE[@]}; do :; done
+ for max in ${!aSOFTWARE_NAME[@]}; do :; done
# Check for unused indices
local free=''
- for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_INSTALL_STATE[$i]} ]] || free+=" $i"; done
+ for (( i=0; i<=$max; i++ )); do [[ ${aSOFTWARE_NAME[$i]} ]] || free+=" $i"; done
echo "Free software ID(s):${free:- None, so use $(($max+1))!}"
@@ -15321,13 +14928,12 @@ _EOF_
if G_WHIP_INPUTBOX 'Please enter a software title/index to search (eg: desktop/cloud/media/torrent)'; then
G_WHIP_CHECKLIST_ARRAY=()
- local item_found=0
search_string=$G_WHIP_RETURNED_VALUE
- for i in ${!aSOFTWARE_INSTALL_STATE[@]}
+ for i in ${!aSOFTWARE_NAME[@]}
do
if (( ${aSOFTWARE_AVAIL_G_HW_MODEL[$i,$G_HW_MODEL]:=1} && ${aSOFTWARE_AVAIL_G_HW_ARCH[$i,$G_HW_ARCH]:=1} && ${aSOFTWARE_AVAIL_G_DISTRO[$i,$G_DISTRO]:=1} )) &&
- [[ $search_string == $i || ${aSOFTWARE_WHIP_NAME[$i],,} == *${search_string,,}* || ${aSOFTWARE_WHIP_DESC[$i],,} == *${search_string,,}* ]]; then
+ [[ $search_string == $i || ${aSOFTWARE_NAME[$i],,} == *${search_string,,}* || ${aSOFTWARE_DESC[$i],,} == *${search_string,,}* ]]; then
local selected='off'
if (( ${aSOFTWARE_INSTALL_STATE[$i]} > 0 )); then
@@ -15343,24 +14949,24 @@ _EOF_
fi
- G_WHIP_CHECKLIST_ARRAY+=($i "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" "$selected")
+ G_WHIP_CHECKLIST_ARRAY+=($i "${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" "$selected")
display_software_menu=1
fi
done
- (( ! $display_software_menu )) && G_WHIP_MSG "Search was unable to find any items for '$search_string'"
+ (( $display_software_menu )) || G_WHIP_MSG "Search was unable to find any items for '$search_string'"
fi
# Generate Whiptail menu list, of all items in specific software type, based on category
else
- # - Prewarnings - Linux
+ # Prewarnings - Linux
if (( $input_mode == 1 )); then
- # Inform User that DietPi software will automatically install additional linux software when required.
+ # Inform User that DietPi software will automatically install additional linux software when required.
if (( ! $USER_LINUX_AUTOINSTALL_PROMPT_DISPLAYED )); then
G_WHIP_MSG 'DietPi will automatically install additional Linux software on the next screen, when required (eg: Desktop LXDE will install ALSA + Xserver).\n\nThis means you only need to select the software you actually require.'
@@ -15429,7 +15035,7 @@ _EOF_
fi
# Add this option to whiptail list
- G_WHIP_CHECKLIST_ARRAY+=($j "${aSOFTWARE_WHIP_NAME[$j]}: ${aSOFTWARE_WHIP_DESC[$j]}" $selected)
+ G_WHIP_CHECKLIST_ARRAY+=($j "${aSOFTWARE_NAME[$j]}: ${aSOFTWARE_DESC[$j]}" $selected)
fi
@@ -15802,7 +15408,7 @@ This will allow you to choose which program loads automatically, after the syste
'Uninstall')
- TARGETMENUID=3
+ Menu_Uninstall_Software
;;
@@ -15814,13 +15420,13 @@ This will allow you to choose which program loads automatically, after the syste
'Software Optimised')
- TARGETMENUID=1
+ Menu_CreateSoftwareList 0
;;
'Software Additional'*)
- TARGETMENUID=2
+ Menu_CreateSoftwareList 1
;;
@@ -16184,7 +15790,7 @@ List of installed software and their URL links for online docs:
if (( ${aSOFTWARE_INSTALL_STATE[i]} > 0 )) && [[ ${aSOFTWARE_ONLINEDOC_URL[$i]} ]]; then
- string+="\n${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}"
+ string+="\n${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}"
string+="\n$FP_ONLINEDOC_URL${aSOFTWARE_ONLINEDOC_URL[$i]}\n"
fi
@@ -16240,13 +15846,13 @@ List of installed software and their URL links for online docs:
Menu_ConfirmInstall(){
# Obtain list of pending software installation:
- local string_output=''
+ local string_output
for i in ${!aSOFTWARE_INSTALL_STATE[@]}
do
if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 1 )); then
- string_output+="\n - ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}"
+ string_output+="\n - ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}"
fi
@@ -16257,15 +15863,8 @@ List of installed software and their URL links for online docs:
if G_WHIP_YESNO "DietPi is now ready to install your software choices: $string_output\n
Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nWould you like to begin?"; then
- # Exit menu system
- TARGETMENUID=-1
-
- # Enable installation start flag
- GOSTARTINSTALL=1
-
- else
-
- TARGETMENUID=0 # Return to Main Menu
+ TARGETMENUID=-1 # Exit menu loop
+ GOSTARTINSTALL=1 # Set install start flag
fi
@@ -16273,73 +15872,39 @@ Software details, usernames, passwords etc:\n - https://dietpi.com/software\n\nW
Menu_StartInstall(){
- # Check if the user has made changes to their software selections.
+ # Check if user made/changed software selections
if (( $INSTALL_SOFTWARE_CHOICESMADE ||
$INSTALL_SSHSERVER_CHOICESMADE ||
$INSTALL_FILESERVER_CHOICESMADE ||
$INSTALL_LOGGING_CHOICESMADE )); then
- # Confirm install with user
+ # List selections and ask for confirmation
Menu_ConfirmInstall
- else
-
- # 1st run install
- if (( $G_DIETPI_INSTALL_STAGE == 1 )); then
+ # Allow to finish first run setup without any selections
+ elif (( $G_DIETPI_INSTALL_STAGE == 1 )); then
- if G_WHIP_YESNO 'DietPi was unable to detect any additional software selections for install.\n
+ if G_WHIP_YESNO 'DietPi was unable to detect any additional software selections for install.\n
NB: You can use dietpi-software at a later date, to install optimised software from our catalogue as required.\n
Do you wish to continue with DietPi as a pure minimal image?'; then
- TARGETMENUID=-1 # Exit menu
-
- DISABLE_REBOOT=1
-
- # Enable installation start flag
- GOSTARTINSTALL=1
-
- else
-
- TARGETMENUID=0 # Main menu
-
- fi
-
- # Not 1st run
- elif (( $G_DIETPI_INSTALL_STAGE == 2 )); then
-
- G_WHIP_MSG 'No changes have been detected. Unable to start installation.'
+ TARGETMENUID=-1 # Exit menu loop
+ DISABLE_REBOOT=1 # Skip reboot as no software will be installed
+ GOSTARTINSTALL=1 # Set install start flag
fi
- fi
-
- }
-
- # TARGETMENUID=1
- Menu_Dietpi_Software(){
-
- # Generate Whiptail menu and store results into our software arrays
- Menu_CreateSoftwareList 0
-
- TARGETMENUID=0 # Main menu
-
- }
-
- # TARGETMENUID=2
- Menu_Linux_Software(){
+ # After first run setup has finished, abort install without any selections
+ elif (( $G_DIETPI_INSTALL_STAGE == 2 )); then
- # Generate Whiptail menu and store results into our software arrays
- Menu_CreateSoftwareList 1
+ G_WHIP_MSG 'No changes have been detected. Unable to start installation.'
- TARGETMENUID=0 # Main menu
+ fi
}
- # TARGETMENUID=3
Menu_Uninstall_Software(){
- TARGETMENUID=0 # Return to Main Menu
-
# Array which will hold all software IDs to be removed.
G_WHIP_CHECKLIST_ARRAY=()
@@ -16352,7 +15917,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
if (( ${aSOFTWARE_INSTALL_STATE[$i]} == 2 &&
${aSOFTWARE_TYPE[$i]:=-2} > -2 )); then
- G_WHIP_CHECKLIST_ARRAY+=($i "${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}" 'off')
+ G_WHIP_CHECKLIST_ARRAY+=($i "${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}" 'off')
software_available_for_uninstall=1
fi
@@ -16375,7 +15940,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
for i in $G_WHIP_RETURNED_VALUE
do
- output_string+=" - ${aSOFTWARE_WHIP_NAME[$i]}: ${aSOFTWARE_WHIP_DESC[$i]}\n"
+ output_string+=" - ${aSOFTWARE_NAME[$i]}: ${aSOFTWARE_DESC[$i]}\n"
UNINSTALL_REQUIRED=1
done
@@ -16405,7 +15970,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
# - Start services
[[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services start
- G_WHIP_MSG 'Uninstall completed.'
+ G_WHIP_MSG 'Uninstall completed'
else
@@ -16427,19 +15992,19 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
Banner_Installing(){
- G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_WHIP_NAME[$software_id]}: ${aSOFTWARE_WHIP_DESC[$software_id]}"
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Installing ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"
}
Banner_Configuration(){
- G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_WHIP_NAME[$software_id]}: ${aSOFTWARE_WHIP_DESC[$software_id]}"
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Configuring ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"
}
Banner_Uninstalling(){
- G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_WHIP_NAME[$software_id]}: ${aSOFTWARE_WHIP_DESC[$software_id]}"
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "Uninstalling ${aSOFTWARE_NAME[$software_id]}: ${aSOFTWARE_DESC[$software_id]}"
}
@@ -16499,6 +16064,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
if [[ $1 ]]; then
Input_Modes "$@"
+ DISABLE_REBOOT=1 # Skip reboot on automated (re)installs
#--------------------------------------------------------------------------------------
# Standard launch
@@ -16507,16 +16073,16 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
# 1st run dietpi-software
if (( $G_DIETPI_INSTALL_STAGE == 1 )); then
- # - Load all automation vars
+ # Load all automation vars
FirstRun_Automation_Init
- # - Global PW
- # Automation, apply as per dietpi.txt
+ # Global PW
+ # - Automation, apply as per dietpi.txt
if (( $AUTOINSTALL_ENABLED )); then
/DietPi/dietpi/func/dietpi-set_software passwords "$GLOBAL_PW"
- # Prompt change global password and login passwords for root and dietpi users
+ # - Prompt change global password and login passwords for root and dietpi users
else
/DietPi/dietpi/func/dietpi-set_software passwords
@@ -16524,48 +16090,60 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
fi
- # - Disable serial? Must stay enabled for the following:
- # XU4: HC1/HC2 fail to boot into kernel without: https://github.com/MichaIng/DietPi/issues/2038#issuecomment-416089875
- # RockPro64: Fails to boot into kernel without
- # NanoPi Neo Air: Required for end users/debugging/setting up WiFi without automation
+ # Disable serial? Must stay enabled for the following:
+ # - XU4: HC1/HC2 fail to boot into kernel without: https://github.com/MichaIng/DietPi/issues/2038#issuecomment-416089875
+ # - RockPro64: Fails to boot into kernel without
+ # - NanoPi Neo Air: Required for end users/debugging/setting up WiFi without automation
+ keep_serial0=1
if grep -q '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=1' /DietPi/dietpi.txt &&
(( $G_HW_MODEL != 11 && $G_HW_MODEL != 42 && $G_HW_MODEL != 64 )) &&
G_WHIP_YESNO 'Serial console is currently enabled, would you like to disable it?\n - Disabling serial console will reduce memory consumption slightly\n - If you are unsure on what serial console is, it is safe to disable it'; then
/DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
+ keep_serial0=0
fi
- fi
+ # RPi: Convert "serial0" to its actual symlink target
+ if (( $G_HW_MODEL < 10 )); then
- # Prevent continue if no Network or NTPD is not completed: https://github.com/MichaIng/DietPi/issues/786
- Check_Internet_and_NTPD
+ if [[ $keep_serial0 == 1 && -L '/dev/serial0' ]]; then
- # - Apply 1st run automation
- (( $G_DIETPI_INSTALL_STAGE == 1 )) && FirstRun_Automation_Set
+ tty=$(readlink -f /dev/serial0); tty={tty#\/dev\/}
+ if [[ $( -1 )); do
+ [[ $( -1 )); do
- fi
+ printf '\ec' # clear current terminal screen
+ Menu_Main
done
@@ -16573,8 +16151,15 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
#--------------------------------------------------------------------------------------
# Start DietPi-Software installs
- # - Check for at least 500M free space available
- if (( $GOSTARTINSTALL )) && G_CHECK_FREESPACE / 500; then
+ if (( $GOSTARTINSTALL )); then
+
+ # Check for sufficient free space, 500 MiB should be enough for most software selections
+ if ! G_CHECK_FREESPACE / 500; then
+
+ G_DIETPI-NOTIFY 1 'Install aborted due to insufficient free space'
+ exit 1
+
+ fi
# Userdata location verify
G_CHECK_USERDATA
@@ -16590,8 +16175,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
G_RUN_CMD systemctl unmask systemd-logind
# systemd-logind is currently a static unit, but to be failsafe:
- systemctl enable systemd-logind &> /dev/null
- systemctl start systemd-logind &> /dev/null
+ systemctl enable --now systemd-logind &> /dev/null
fi
@@ -16603,7 +16187,7 @@ Do you wish to continue with DietPi as a pure minimal image?'; then
if (( $DISABLE_REBOOT )); then
- # - Start services (restart to reload webserver configs)
+ # - Start services (restart to reload configs of possible running services)
[[ $G_SERVICE_CONTROL == 0 ]] || /DietPi/dietpi/dietpi-services restart
else
diff --git a/dietpi/dietpi-survey b/dietpi/dietpi-survey
index e439acbc0a..71efa9e38e 100644
--- a/dietpi/dietpi-survey
+++ b/dietpi/dietpi-survey
@@ -109,7 +109,7 @@ _EOF_
- https://github.com/MichaIng/DietPi/issues or https://dietpi.com/phpbb/viewforum.php?f=11'
# Check if we have a working internet connection beforehand
- if G_USER_INPUTS=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL $SFTP_ADDR; then
+ if G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_CHECK_URL $SFTP_ADDR; then
if (( $OPTED_IN )); then
@@ -161,7 +161,7 @@ _EOF_
OPTED_IN=$(sed -n '/^[[:blank:]]*SURVEY_OPTED_IN=[01]$/{s/^[^=]*=//;p;q}' /DietPi/dietpi.txt)
# Force interactive menu if no choice was done yet
- elif (( $G_USER_INPUTS )); then
+ elif (( $G_INTERACTIVE )); then
INPUT=0
diff --git a/dietpi/dietpi-sync b/dietpi/dietpi-sync
index 138477a1c2..73f8c8d383 100644
--- a/dietpi/dietpi-sync
+++ b/dietpi/dietpi-sync
@@ -17,19 +17,19 @@
# - /DietPi/dietpi/dietpi-sync 1 = Sync
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Sync'
G_CHECK_ROOT_USER
G_CHECK_ROOTFS_RW
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- #Restart rsync service, if stopped during DietPi-Sync run: https://github.com/MichaIng/DietPi/issues/1869
+ # Restart rsync service, if stopped during DietPi-Sync run: https://github.com/MichaIng/DietPi/issues/1869
SERVICE_CONTROL=0
G_EXIT_CUSTOM(){ (( $SERVICE_CONTROL )) && G_RUN_CMD systemctl start rsync; }
- #Grab Input (valid interger)
+ # Grab Input (valid interger)
INPUT=0
disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1
@@ -38,7 +38,7 @@
#/////////////////////////////////////////////////////////////////////////////////////
EXIT_CODE=0
- #File paths
+ # File paths
FP_SETTINGS='/DietPi/dietpi/.dietpi-sync_settings'
FP_FILTER_INCLUDE_EXCLUDE='.dietpi-sync_include_exclude'
FP_USER_FILTER_INCLUDE_EXCLUDE='/DietPi/dietpi/.dietpi-sync_inc_exc'
@@ -47,13 +47,13 @@
FP_SOURCE='/mnt/source'
FP_TARGET='/mnt/target'
- #Extra settings
+ # Extra settings
SYNC_DELETE_MODE=0
SYNC_CRONDAILY=0
Create_Filter_Include_Exclude(){
- #Exclude files by name
+ # Exclude files by name
cat << _EOF_ > $FP_FILTER_INCLUDE_EXCLUDE
- $FP_LOG
- $FP_FILTER_INCLUDE_EXCLUDE
@@ -66,7 +66,7 @@
- System Volume Information # causes error code 23 (permission denied)
_EOF_
- #Exclude specific files/dirs by path
+ # Exclude specific files/dirs by path
local aexclude=(
"$FP_TARGET"
@@ -87,7 +87,7 @@ _EOF_
unset aexclude
- #Add users additional list
+ # Add users additional list
[[ -f $FP_USER_FILTER_INCLUDE_EXCLUDE ]] && cat $FP_USER_FILTER_INCLUDE_EXCLUDE >> $FP_FILTER_INCLUDE_EXCLUDE
}
@@ -117,7 +117,7 @@ _EOF_
#Error: Empty source dir
elif [[ ! $(ls -A "$FP_SOURCE") ]]; then
-
+
G_WHIP_MSG "[FAILED] The chosen source directory is empty: $FP_SOURCE\n\nPlease check it's path and in case verify that it's mount is active."
# Log to target dir directly, preserve previous rsync log
echo "$(date +"%d-%m-%Y_%T") [FAILED] The chosen source directory is empty: $FP_SOURCE" >> "$FP_TARGET/$FP_LOG"
diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update
index 19ed6d36e0..25e1f6e6be 100644
--- a/dietpi/dietpi-update
+++ b/dietpi/dietpi-update
@@ -10,15 +10,16 @@
#////////////////////////////////////
#
# Info:
+ # - Location: /{DietPi,boot}/dietpi/dietpi-update
# - Updates DietPi from Git or dietpi.com repo
- # - Uses patch_file for incremental online patching
- # - Uses pre-patch_file for critical fixes and update related changes
+ # - Uses pre-patch_file for patches that need to be done prior to APT calls and DietPi code update
+ # - Uses patch_file for incremental patching after APT calls and DietPi code update
#
# Usage:
- # - dietpi-update = Normal
- # - dietpi-update 1 = noninteractive update
- # - dietpi-update 2 = Check for updates. print server_version to /DietPi/dietpi/.update_available (-1=new image required)
- # - dietpi-update -1 = Include reapplying the current subversion patch, e.g. to update dev branch
+ # - dietpi-update = Check for updates and in case open interactive menu
+ # - dietpi-update 1 = Check for updates and in case apply noninteractively
+ # - dietpi-update 2 = Check for updates only and in case store result to /DietPi/dietpi/.update_available to be used by DietPi-Banner
+ # - dietpi-update -1 = Like "1" but internally reduce subversion by 1 to reapply the last update, e.g. to apply latest dev branch changes
#////////////////////////////////////
# Import DietPi-Globals --------------------------------------------------------------
@@ -30,27 +31,27 @@
# Import DietPi-Globals --------------------------------------------------------------
# Move tmp log to persistent location on exit
- G_EXIT_CUSTOM(){ [[ -f $FP_TMP_LOG ]] && mv $FP_TMP_LOG $FP_LOG; }
+ G_EXIT_CUSTOM(){ [[ -f $FP_LOG_TMP ]] && mv $FP_LOG_TMP $FP_LOG; }
+ # Grab input
disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0
#/////////////////////////////////////////////////////////////////////////////////////
# UPDATE Vars
#/////////////////////////////////////////////////////////////////////////////////////
FP_LOG='/var/tmp/dietpi/logs/dietpi-update.log'
- FP_TMP_LOG='dietpi-update.log'
+ FP_LOG_TMP='dietpi-update.log'
DIETPIUPDATE_VERSION_CORE=6 # Version of dietpi-update / set server_version-6 line one to value++ and obsolete previous dietpi-update scripts
CHANGELOG_DOWNLOADED=0 # Prevent redownload of changelog if already done in this session
SERVER_ONLINE=0
UPDATE_AVAILABLE=0
- UPDATE_REQUIRESNEWIMAGE=0
RUN_UPDATE=0
- GITOWNER_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITOWNER=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ GITOWNER_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
GITOWNER_TARGET=${GITOWNER_TARGET:-MichaIng}
- GITBRANCH_TARGET=$(grep -m1 '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
GITBRANCH_TARGET=${GITBRANCH_TARGET:-master}
COREVERSION_SERVER=0
@@ -111,9 +112,9 @@
if curl -sSL "${aURL_MIRROR_SERVERVERSION[$i]}" > server_version; then
# Get server version
- COREVERSION_SERVER=$(sed -n 1p server_version)
- SUBVERSION_SERVER=$(sed -n 2p server_version)
- RCVERSION_SERVER=$(sed -n 3p server_version)
+ COREVERSION_SERVER=$(mawk 'NR==1' server_version)
+ SUBVERSION_SERVER=$(mawk 'NR==2' server_version)
+ RCVERSION_SERVER=$(mawk 'NR==3' server_version)
# Check if server version contains valid intergers
if disable_error=1 G_CHECK_VALIDINT "$COREVERSION_SERVER" &&
@@ -158,8 +159,6 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss
# Update requires new image
if (( $DIETPIUPDATE_VERSION_CORE < $COREVERSION_SERVER )); then
- UPDATE_REQUIRESNEWIMAGE=1
-
# Write "-1" to flag file for DietPi-Banner to show info about required new image
echo '-1' > /DietPi/dietpi/.update_available
@@ -167,7 +166,7 @@ If this error persists, please report at: https://github.com/MichaIng/DietPi/iss
Please download the latest DietPi image from: https://dietpi.com/#download'
# Update available
- elif (( $G_DIETPI_VERSION_SUB < $SUBVERSION_SERVER ||
+ elif (( $G_DIETPI_VERSION_SUB < $SUBVERSION_SERVER ||
( $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER && $G_DIETPI_VERSION_RC < $RCVERSION_SERVER ) )); then
UPDATE_AVAILABLE=1
@@ -183,8 +182,8 @@ Please download the latest DietPi image from: https://dietpi.com/#download'
# Mark 1st run update as completed
Apply_1st_Run_Update_Success
- # Remove .update_available flag file
- rm -f /DietPi/dietpi/.update_available
+ # Remove .update_available flag file (from disk as well, to prevent update notification after reboot)
+ rm -f /{DietPi,boot}/dietpi/.update_available
G_DIETPI-NOTIFY 0 'No update required, your DietPi installation is already up to date:'
@@ -200,79 +199,82 @@ Please download the latest DietPi image from: https://dietpi.com/#download'
#/////////////////////////////////////////////////////////////////////////////////////
Run_Update(){
- # Applying pre-patch
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches'
G_RUN_CMD wget "${aURL_MIRROR_PREPATCH[$URL_MIRROR_INDEX]}" -O pre-patch_file
chmod +x pre-patch_file
- if ! ./pre-patch_file $G_DIETPI_VERSION_SUB; then
+ # Rerun last subversion pre-patch for RC-only updates
+ local subversion=$G_DIETPI_VERSION_SUB
+ (( $G_DIETPI_VERSION_SUB == $SUBVERSION_SERVER )) && subversion=$(( $G_DIETPI_VERSION_SUB - 1 ))
+ if ! ./pre-patch_file $subversion; then
- G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check terminal messages for errors, or $FP_LOG, and retry dietpi-update in case of follow-up errors."
+ G_DIETPI-NOTIFY 1 "An error occured during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved."
exit 1
fi
+ G_DIETPI-NOTIFY 0 'Successfully applied pre-patches'
- # Update APT packages
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Upgrading APT packages'
G_AGUP
G_AGUG
- # Git clone Zip method (no need to install Git)
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Installing new DietPi code'
if curl -L# "${aURL_MIRROR_ZIP[$URL_MIRROR_INDEX]}" > update.zip; then
- l_message='Unpack update archive' G_RUN_CMD unzip update.zip
+ l_message='Unpacking update archive' G_RUN_CMD unzip update.zip
rm update.zip
- # Remove files from Git that are not to be updated on client
- rm DietPi-"$GITBRANCH_TARGET"/dietpi/server_version*
- rm DietPi-"$GITBRANCH_TARGET"/dietpi/pre-patch_file
+ # Remove files from Git archive that are not to be installed on client
+ rm DietPi-"$GITBRANCH_TARGET"/dietpi/{pre-patch_file,server_version*}
# Remove old code before updating, so we dont need to patch for removals
# - https://github.com/MichaIng/DietPi/issues/905#issuecomment-298241622
#rm -R /DietPi/dietpi/{func,misc,dietpi-*}
- l_message='Copy DietPi core files to RAMdisk' G_RUN_CMD cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /DietPi/
- l_message='Copy DietPi rootfs files in place' G_RUN_CMD cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. /
- l_message='Set execute permissions for DietPi scripts' G_RUN_CMD chmod -R +x /DietPi/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi
+ l_message='Installing new DietPi scripts to RAMdisk' G_RUN_CMD cp -Rf DietPi-"$GITBRANCH_TARGET"/dietpi /DietPi/
+ l_message='Installing new DietPi system files to disk' G_RUN_CMD cp -Rf DietPi-"$GITBRANCH_TARGET"/rootfs/. /
+ l_message='Setting execute permissions for DietPi scripts' G_RUN_CMD chmod -R +x /DietPi/dietpi /var/lib/dietpi/services /etc/cron.*/dietpi
- # Update Git owner/branch now, to download from matching branch, e.g. on reinstalls
+ # Update Git owner/branch now, to download from matching branch during dietpi.txt verification and incremental patches, e.g. on reinstalls
G_GITOWNER=$GITOWNER_TARGET
G_GITBRANCH=$GITBRANCH_TARGET
G_VERSIONDB_SAVE
- # Verify/update dietpi.txt entries:
- /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt
+ # Verify/update dietpi.txt entries
+ /DietPi/dietpi/func/dietpi-set_software verify_dietpi.txt || exit 1
# Failsafe: Sync changes to disk
sync
systemctl daemon-reload
- G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Running incremental patching'
+ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying incremental patches'
G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION"
G_DIETPI-NOTIFY 2 "$INFO_SERVER_VERSION"
- # Subversion update, run patch
+ # Apply subversion patches incrementally
while (( $G_DIETPI_VERSION_SUB < $SUBVERSION_SERVER )); do
G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB to $COREVERSION_SERVER.$(( $G_DIETPI_VERSION_SUB + 1 ))"
- /DietPi/dietpi/patch_file $G_DIETPI_VERSION_SUB
+ /DietPi/dietpi/patch_file $G_DIETPI_VERSION_SUB || exit 1
G_DIETPI_VERSION_SUB=$(( $G_DIETPI_VERSION_SUB + 1 ))
- G_DIETPI_VERSION_RC=$RCVERSION_SERVER # Cancel any RC updates, as subversions override it
+ G_DIETPI_VERSION_RC=$RCVERSION_SERVER # Subversion patches include latest RC update
done
- # RC update, rerun current subversion as patch.
+ # RC-only update, rerun last subversion patch
if (( $G_DIETPI_VERSION_RC < $RCVERSION_SERVER )); then
G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC to $COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER"
- /DietPi/dietpi/patch_file $(( $G_DIETPI_VERSION_SUB - 1 )) # Rerun current subversion patch for RCs
+ /DietPi/dietpi/patch_file $(( $G_DIETPI_VERSION_SUB - 1 )) || exit 1
G_DIETPI_VERSION_RC=$RCVERSION_SERVER
fi
- G_DIETPI-NOTIFY 0 "Patching to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER completed\n"
+ G_DIETPI-NOTIFY 0 "Incremental patching to v$COREVERSION_SERVER.$SUBVERSION_SERVER.$RCVERSION_SERVER completed"
# Remove patch_file
rm /DietPi/dietpi/patch_file
- # Save current version and Git owner/branch info
+ # Save current version and Git owner/branch
G_VERSIONDB_SAVE
# Update info strings
@@ -281,7 +283,7 @@ Please download the latest DietPi image from: https://dietpi.com/#download'
# Unable to download file.
else
- G_DIETPI-NOTIFY 1 'Download failed, unable to run update. Please try to rerun dietpi-update.'
+ G_DIETPI-NOTIFY 1 'Download failed, unable to run update. Please try to rerun "dietpi-update".'
exit 1
fi
@@ -407,41 +409,30 @@ When DietPi applies updates, all system services will be temporarily stopped. Do
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
#----------------------------------------------------------------
- # Inform user
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Checking for DietPi updates'
#----------------------------------------------------------------
- # Get server version
+ # Select mirror and download server version info
Get_Server_Version
#----------------------------------------------------------------
- # Reduce current subversion by 1 to reapply current subversion patch, if requested
+ # If requested, reduce current subversion by 1 to reapply last update
if (( $INPUT == -1 )); then
- if (( $G_DIETPI_VERSION_SUB < 0 )); then
-
- G_DIETPI-NOTIFY 1 'Repatch was requested, but will be skipped, as your device seems to be on lowest subversion already'
-
- else
-
- G_DIETPI_VERSION_SUB=$(( $G_DIETPI_VERSION_SUB - 1 ))
- G_DIETPI-NOTIFY 0 'Repatch was requested: Update will reapply the current subversion patch'
-
- fi
-
+ G_DIETPI_VERSION_SUB=$(( $G_DIETPI_VERSION_SUB - 1 ))
+ G_DIETPI-NOTIFY 0 "Repatch was requested: Subversion internally reduced to \"$G_DIETPI_VERSION_SUB\" to reapply the last update"
INPUT=1
fi
#----------------------------------------------------------------
- # Check if update is available
+ # Check for update and in case store result to /DietPi/dietpi/.update_available for use by DietPi-Banner
Check_Update_Available
#----------------------------------------------------------------
- # Update available
- # - $INPUT == 2: Check for updates only. Send result to flag file for use by DietPi-Banner.
+ # Update available and no check-only chosen
if (( $UPDATE_AVAILABLE && $INPUT != 2 )); then
# Verify userdata location
G_CHECK_USERDATA
- # Insufficient free space
+ # Check for sufficient free space
G_CHECK_FREESPACE / 100 || exit 1
# Noninteractive update or ask user
@@ -456,9 +447,6 @@ When DietPi applies updates, all system services will be temporarily stopped. Do
# Disable powersaving on main screen
setterm -blank 0 -powersave off 2> /dev/null
- # Remove old log
- [[ -f $FP_LOG ]] && rm $FP_LOG
-
# Stop Services
/DietPi/dietpi/dietpi-services stop
@@ -466,7 +454,8 @@ When DietPi applies updates, all system services will be temporarily stopped. Do
# - Pre-estimate and override terminal size variables, since they cannot be estimated, if STOUT and STERR are redirected: https://github.com/MichaIng/DietPi/issues/2105
export G_WHIP_SIZE_X_OVERRIDE=$(tput cols)
export G_WHIP_SIZE_Y_OVERRIDE=$(tput lines)
- Run_Update 2>&1 | tee $FP_TMP_LOG
+ # - Log to file by redirecting to subshell instead of piping, else G_ERROR_HANDLER cannot exit the script via "kill -INT $$": https://github.com/MichaIng/DietPi/issues/3127
+ Run_Update &> >(tee $FP_LOG_TMP); wait $!
unset G_WHIP_SIZE_X_OVERRIDE G_WHIP_SIZE_Y_OVERRIDE
# Mark 1st run update as completed
@@ -488,12 +477,13 @@ When DietPi applies updates, all system services will be temporarily stopped. Do
l_message='Syncing new DietPi scripts to disk' G_RUN_CMD /DietPi/dietpi/func/dietpi-ramdisk 1
> /DietPi/.ramdisk
+ # Start services only on finished install state, else dietpi-software will follow immediately
(( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-services restart
fi
#----------------------------------------------------------------
- # Desktop Run, exit key prompt
+ # Desktop run, exit key prompt
pgrep 'lxsession' &> /dev/null && read -p 'Press any key to exit DietPi-Update...'
fi
diff --git a/dietpi/func/create_mysql_db b/dietpi/func/create_mysql_db
index 8ca5040a40..2238e7ab2d 100644
--- a/dietpi/func/create_mysql_db
+++ b/dietpi/func/create_mysql_db
@@ -13,32 +13,32 @@
# - mysqladmin drop phpbb3 -f
#////////////////////////////////////
- DATABASE_NAME="$1"
- DATABASE_USER="$2"
- DATABASE_PW="$3"
- #Import DietPi-Globals ---------------------------------------------------------------
+ DATABASE_NAME=$1
+ DATABASE_USER=$2
+ DATABASE_PW=$3
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Create_MySQL_DB'
G_CHECK_ROOT_USER
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
# Skip database creation, if already existent
- [[ -d /var/lib/mysql/$DATABASE_NAME ]] && G_DIETPI-NOTIFY 2 "\"$DATABASE_NAME\" MariaDB database already exists. Aborting..." && exit
+ [[ -d '/var/lib/mysql/'$DATABASE_NAME ]] && G_DIETPI-NOTIFY 2 "\"$DATABASE_NAME\" MariaDB database already exists. Aborting..." && exit
# Start MySQL if not running.
- (( G_DISTRO < 4 )) && systemctl start mysql &> /dev/null || systemctl start mariadb &> /dev/null
+ systemctl start mariadb &> /dev/null
G_DIETPI-NOTIFY 2 "Creating MariaDB database: $DATABASE_NAME"
# Generate DB
# - 'identified by' can overwrite unix_socket authentication, thus use this for non-root users only.
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 -e "create database \`$DATABASE_NAME\`;$grant_privileges"
G_DIETPI-NOTIFY -1 "$?" "Creating MariaDB database: $DATABASE_NAME |"
diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner
index 4dc5937af5..54b0f56494 100644
--- a/dietpi/func/dietpi-banner
+++ b/dietpi/func/dietpi-banner
@@ -13,16 +13,12 @@
# - Checks /DietPi/dietpi/.update_available
#
# Usage:
- # - dietpi-banner 0 = top section only
- # - dietpi-banner 1 = top section and credits + clear
+ # - dietpi-banner 0 = top section + LAN IP
+ # - dietpi-banner 1 = top section + chosen entries + credits + clear
# - dietpi-banner 2 = banner customisation menu
#////////////////////////////////////
- # Import DietPi-Globals --------------------------------------------------------------
- # Do in main menu and on demand
- # Import DietPi-Globals --------------------------------------------------------------
-
- [[ $1 == [012] ]] && INPUT=$1 || INPUT=0
+ [[ $1 == [12] ]] && INPUT=$1 || INPUT=0
#/////////////////////////////////////////////////////////////////////////////////////
# Globals
@@ -45,10 +41,11 @@
'Custom banner entry'
'Display DietPi useful commands?'
'MOTD'
+ 'NordVPN status'
)
# Set defaults
- aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1)
+ aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0)
COLOUR_RESET='\e[0m'
aCOLOUR=(
@@ -87,7 +84,8 @@
Save(){
- > $FP_SAVEFILE
+ # Custom entry description
+ echo "aDESCRIPTION[10]='${aDESCRIPTION[10]}'" > $FP_SAVEFILE
for i in ${!aDESCRIPTION[@]}
do
@@ -96,9 +94,6 @@
done
- # Safe custom entry description
- echo "aDESCRIPTION[10]='${aDESCRIPTION[10]}'" >> $FP_SAVEFILE
-
for i in ${!aCOLOUR[@]}
do
@@ -112,7 +107,7 @@
# Update Available?
Obtain_Update_Available
- local text_update_available_date=''
+ local text_update_available_date
if (( $UPDATE_AVAILABLE )); then
if [[ $UPDATE_AVAILABLE_VERSION == '-1' ]]; then
@@ -127,7 +122,8 @@
else
- text_update_available_date=$(date +"%R - %a %x")
+ local locale_current=$(sed -n '/^[[:blank:]]*AUTO_SETUP_LOCALE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ text_update_available_date=$(LC_ALL=${locale_current:-en_GB.UTF-8} date +"%R - %a %x")
fi
@@ -139,7 +135,9 @@ $GREEN_LINE"
Print_Local_Ip(){
- echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPARATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" #5: LAN IP (adapter)
+ [[ ${aENABLED[5]} == 1 ]] || return
+ [[ -f '/DietPi/dietpi/.network' ]] && /DietPi/dietpi/func/obtain_network_details
+ echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPARATOR $(mawk 'NR==3 {dev=$0} NR==4 {print $0" ("dev")"}' /DietPi/dietpi/.network 2>&1)" # 5: LAN IP (adapter)
}
@@ -147,13 +145,13 @@ $GREEN_LINE"
echo -e " ${aCOLOUR[2]}DietPi Team : MichaIng (lead), Daniel Knight (founder)"
- [[ -f /DietPi/dietpi/.prep_info ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /DietPi/dietpi/.prep_info
+ [[ -f '/DietPi/dietpi/.prep_info' ]] && mawk 'NR==1 {sub(/^0$/,"DietPi Core Team");a=$0} NR==2 {print " Image : "a" (pre-image: "$0")"}' /DietPi/dietpi/.prep_info
echo ' Web : https://DietPi.com | https://twitter.com/dietpi_
Patreon Legends : PINE64 community | oct8l
Donate : https://DietPi.com/#donate'
- local image_additional_credits=$(sed -n 8p /DietPi/dietpi/.hw_model)
+ local image_additional_credits=$(mawk 'NR==8 {print}' /DietPi/dietpi/.hw_model 2>&1)
[[ $image_additional_credits ]] && echo " Device image possible thanks to: $image_additional_credits"
echo -e " DietPi Hosting : Powered by https://MyVirtualServer.com$COLOUR_RESET\n"
@@ -187,34 +185,39 @@ $GREEN_LINE"
Print_Banner(){
- # - Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen
+ # Source DietPi-Globals if not yet sourced from main menu and CPU temp chosen
[[ ${aENABLED[2]} != 1 && ${aENABLED[12]} != 1 || $G_PROGRAM_NAME ]] || . /DietPi/dietpi/func/dietpi-globals
- # - Re-obtain network details if missing and LAN IP chosen
- [[ ${aENABLED[5]} != 1 || -f '/DietPi/dietpi/.network' ]] || /DietPi/dietpi/func/obtain_network_details
-
printf '\ec' # clear current terminal screen
Print_Header
- (( ${aENABLED[0]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[0]} $GREEN_SEPARATOR $(mawk 'NR==2 {print $0}' /DietPi/dietpi/.hw_model 2>&1)" #0: Device model
- (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPARATOR $(uptime -p 2>&1)" #1: Uptime
- (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPARATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" #2: CPU temp
- (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPARATOR $(hostname -f 2>&1)" #3: Hostname
- (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPARATOR $(hostname -y 2>&1)" #4: Domain name
- (( ${aENABLED[5]} == 1 )) && Print_Local_Ip
- (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sLm 2 https://dietpi.com/myip.php 2>&1)" #6: WAN IP # Move this to /DietPi/dietpi/.network?
- (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" #7: Freespace (RootFS)
- (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" #8: Freespace (DietPi userdata)
- (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sLm 2 https://wttr.in/?format=4 2>&1)" #9: Weather
- (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" #10: Custom
+ (( ${aENABLED[0]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[0]} $GREEN_SEPARATOR $(mawk 'NR==2 {print}' /DietPi/dietpi/.hw_model 2>&1)" # 0: Device model
+ (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPARATOR $(uptime -p 2>&1)" # 1: Uptime
+ (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPARATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" # 2: CPU temp
+ (( ${aENABLED[3]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPARATOR $(hostname -f 2>&1)" # 3: Hostname
+ (( ${aENABLED[4]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[4]} $GREEN_SEPARATOR $(hostname -y 2>&1)" # 4: Domain name
+ Print_Local_Ip # 5: LAN IP
+ (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://dietpi.com/myip.php 2>&1)" # 6: WAN IP # Move this to /DietPi/dietpi/.network?
+ (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/DietPi/dietpi/misc/dietpi-nordvpn status 2>&1)" # 13: DietPi-NordVPN connection status
+ (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" # 7: Freespace (RootFS)
+ (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" # 8: Freespace (DietPi userdata)
+ (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 2 https://wttr.in/?format=4 2>&1)" # 9: Weather
+ (( ${aENABLED[10]} == 1 )) && [[ -x $FP_CUSTOM ]] && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash $FP_CUSTOM 2>&1)" # 10: Custom
if (( ${aENABLED[12]} == 1 )); then
local fp_motd='/tmp/.dietpi_motd'
- [[ -f $fp_motd ]] || curl -sLm 2 https://dietpi.com/motd > $fp_motd
+ [[ -f $fp_motd ]] || curl -sSfLm 2 https://dietpi.com/motd > $fp_motd
if [[ -f $fp_motd ]]; then
- . $fp_motd # Creates $motd variable
- echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" #12: MOTD
+ if . $fp_motd &> /dev/null && [[ $motd ]]; then
+
+ echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[12]} $GREEN_SEPARATOR $motd" # 12: MOTD
+
+ else
+
+ rm $fp_motd
+
+ fi
fi
@@ -222,7 +225,7 @@ $GREEN_LINE"
echo -e "$GREEN_LINE\n"
Print_Credits
- (( ${aENABLED[11]} == 1 )) && Print_Useful_Commands
+ (( ${aENABLED[11]} == 1 )) && Print_Useful_Commands # 11: Useful commands
}
diff --git a/dietpi/func/dietpi-benchmark b/dietpi/func/dietpi-benchmark
index 8d5cff5a56..e9e4aa07e4 100644
--- a/dietpi/func/dietpi-benchmark
+++ b/dietpi/func/dietpi-benchmark
@@ -13,7 +13,7 @@
# /DietPi/dietpi/func/dietpi-benchmark 0 = init vars for sourcing /var/lib/dietpi/dietpi-benchmark/results
# FP_BENCHFILE=/location BENCH_FILESIZE=optional_size_MiB /DietPi/dietpi/func/dietpi-benchmark 1 = Benchmark $FP_BENCHFILE filesystem read/write.
# /DietPi/dietpi/func/dietpi-benchmark 2 = Run all benchmarks and upload to dietpi.com
- # G_USER_INPUTS=0 /DietPi/dietpi/func/dietpi-benchmark 2 = Same as above, automated
+ # G_INTERACTIVE=0 /DietPi/dietpi/func/dietpi-benchmark 2 = Same as above, automated
# /DietPi/dietpi/func/dietpi-benchmark 3 = iPerf server
# /DietPi/dietpi/func/dietpi-benchmark 4 = iPerf client with prompt
#
@@ -126,22 +126,20 @@ aEnd_Int=()
for (( i=0; i<\$cores; i++ ))
do
- aEnd_Int[\$i]=\$(( (\$i + 1) * \$int_split ))
- aStart_Int[\$i]=\$(( \${aEnd_Int[\$i]} - \$int_split ))
-
- echo \${aStart_Int[\$i]} \${aEnd_Int[\$i]}
+ aEnd_Int[\$i]=\$(( (\$i + 1) * \$int_split ))
+ aStart_Int[\$i]=\$(( \${aEnd_Int[\$i]} - \$int_split ))
+ echo \${aStart_Int[\$i]} \${aEnd_Int[\$i]}
done
-
Run_Bench(){
- while (( \${aStart_Int[\$1]} < \${aEnd_Int[\$1]} ))
- do
+ while (( \${aStart_Int[\$1]} < \${aEnd_Int[\$1]} ))
+ do
- ((aStart_Int[\$1]++))
+ ((aStart_Int[\$1]++))
- done
+ done
}
@@ -149,21 +147,18 @@ Run_Bench(){
for (( i=0; i<\$cores; i++ ))
do
- Run_Bench \$i &
+ Run_Bench \$i &
done
# Wait for jobs to finish
for job in \`jobs -p\`
do
- echo \$job
- wait \$job
-done
-#delete[]
-unset aStart_Int
-unset aEnd_Int
+ echo \$job
+ wait \$job
+done
_EOF_
chmod +x $FP_TEMP/bench
@@ -182,8 +177,8 @@ _EOF_
G_WHIP_MSG "CPU Benchmark Results:\n
- Total time = $BENCH_CPU Seconds
- Value to reach = $CPUBENCH_INT_MAX
- - CPU temps = Start: ${BENCH_CPU_TEMP_START}'c | End: ${BENCH_CPU_TEMP_END}'c\n\n
-NB: A lower 'Total time' is faster"
+ - CPU temps = Start: ${BENCH_CPU_TEMP_START}'c | End: ${BENCH_CPU_TEMP_END}'c
+\n\nNB: A lower 'Total time' is faster"
fi
@@ -221,27 +216,22 @@ NB: A lower 'Total time' is faster"
G_DIETPI-NOTIFY 2 "Performing Read/Write benchmark on $FP_BENCHFILE, please wait..."
G_DIETPI-NOTIFY 2 "Testing Seq Write Speed ($BENCH_FILESIZE MiB)"
-
sleep 1
-
local bench_write_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 1024 / 4 )) if=/dev/zero of=$FP_BENCHFILE conv=fdatasync 2>&1 | grep 'copied')
local temp_bytes_result=$(mawk '{print $1}' <<< "$bench_write_result")
local temp_time_result=$(mawk '{print $8}' <<< "$bench_write_result")
- (( $G_DISTRO < 4 )) && temp_time_result=$(mawk '{print $6}' <<< "$bench_write_result")
# - Convert results from bytes and time to MiB/s
bench_write_result=$(bc -l <<< "scale=0; $temp_bytes_result / $temp_time_result / 1024 / 1024")
# - Clear cache
sync
echo 3 > /proc/sys/vm/drop_caches
- G_DIETPI-NOTIFY 2 "Testing Seq Read Speed ($BENCH_FILESIZE MiB)"
+ G_DIETPI-NOTIFY 2 "Testing Seq Read Speed ($BENCH_FILESIZE MiB)"
sleep 1
-
local bench_read_result=$(dd bs=4K count=$(( $BENCH_FILESIZE * 1024 / 4 )) if=$FP_BENCHFILE of=/dev/null conv=fdatasync 2>&1 | grep 'copied')
temp_bytes_result=$(mawk '{print $1}' <<< "$bench_read_result")
temp_time_result=$(mawk '{print $8}' <<< "$bench_read_result")
- (( $G_DISTRO < 4 )) && temp_time_result=$(mawk '{print $6}' <<< "$bench_read_result")
# - Convert results from bytes and time to MiB/s
bench_read_result=$(bc -l <<< "scale=0; $temp_bytes_result / $temp_time_result / 1024 / 1024")
@@ -284,14 +274,14 @@ NB: A lower 'Total time' is faster"
SHOW_RESULTS=0
mkdir -p /var/lib/dietpi/dietpi-benchmark
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
if G_WHIP_YESNO "$G_PROGRAM_NAME will now run the following benchmarks:\n - CPU performance\n - RootFS read/write performance\n - RAM read/write performance.
The test duration will depend on hardware specs, however, most devices will not exceed 40 seconds.\n\nIf you are opted in to the DietPi-Survey, your scores will uploaded automatically.
You can compare results against other users and hardware using the following link:\n - https://dietpi.com/survey#benchmark\n\nPlease select 'Ok' to begin the benchmark tests."; then
# - Additional checks
- if (( $G_HW_CPU_CORES <= 2 )); then
+ if (( $G_HW_CPU_CORES < 3 )); then
G_WHIP_YESNO "We have detected a low CPU core count ($G_HW_CPU_CORES). The tests may take upto 5 minutes to complete (eg: RaspberryPi Zero).\n\nDo you wish to continue?"
(( $? )) && exit 0
@@ -308,11 +298,9 @@ You can compare results against other users and hardware using the following lin
fi
G_DIETPI-NOTIFY 0 'Running benchmark suite tests, please wait...'
-
CPU_Benchmark
# FS/RAM
-
# - RAM
if df -t tmpfs /tmp &> /dev/null; then
@@ -367,7 +355,6 @@ Compare these results online with other users, using the link below:
if disable_error=1 G_CHECK_VALIDINT "$BENCH_NET_LAN_SPEED"; then
BENCH_NET_LAN_SPEED=$(( $BENCH_NET_LAN_SPEED / 8 / 1024 / 1024 ))
-
G_WHIP_MSG "Network LAN benchmark completed:\n - Transfer rate = $BENCH_NET_LAN_SPEED MiB/s"
else
diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals
index f4b8d63d0d..eab92f7218 100644
--- a/dietpi/func/dietpi-globals
+++ b/dietpi/func/dietpi-globals
@@ -23,27 +23,38 @@
unset G_PROGRAM_NAME
# Debug mode
- # - Do no pre-generate to reduce bash session variables: Needs to be checked via: [[ $G_DEBUG == 1 ]]
+ # - Do no pre-generate to reduce bash session variables => Needs to be checked via: [[ $G_DEBUG == 1 ]]
#G_DEBUG=${G_DEBUG:-0}
- # Flag, if we are in interactive shell, by checking STDIN availability
- # OK | systemd = non-STDIN
- # OK | Cron = non-STDIN
- # NB | ~/.bashrc = STDIN
+ # Interactive mode
# - Affects whether G_ERROR_ and G_WHIP_ prompts are displayed or not
- # NB: You can export G_USER_INPUTS=0 to force non-interactive/automated scipt calls. Run 'unset G_USER_INPUTS' afterwards to return to auto detection.
- if [[ $G_USER_INPUTS != [01] ]]; then
+ # - Run "export G_INTERACTIVE=0" prior to script call to force non-interactive/automated mode.
+ # - Run "unset G_INTERACTIVE" afterwards to return to auto detection.
+ # - If not set, check for STDIN availability:
+ # OK | systemd = no STDIN
+ # OK | Cron = no STDIN
+ # NB | /etc/profile, ~/.profile, /etc/profile.d/, /etc/bash.bashrc, ~/.bashrc and /etc/bashrc.d/ are interactive since those are sourced from originating shell/bash session.
+ if [[ $G_INTERACTIVE != [01] ]]; then
- [[ -t 0 ]] && G_USER_INPUTS=1 || G_USER_INPUTS=0
+ # Backwards compatibility to keep user scripts valid for a while
+ if [[ $G_USER_INPUTS == [01] ]]; then
+
+ G_INTERACTIVE=$G_USER_INPUTS
+
+ else
+
+ [[ -t 0 ]] && G_INTERACTIVE=1 || G_INTERACTIVE=0
+
+ fi
fi
# DietPi First-Run Stage | -2 = PREP_SYSTEM/Unknown | -1 = 1st boot | 0 = 1st run dietpi-update | 1 = 1st run dietpi-software | 2 = completed | 10 = Pre-installed image, converts to 2 during 1st boot
[[ -f '/DietPi/dietpi/.install_stage' ]] && G_DIETPI_INSTALL_STAGE=$( Needs to be checked via: [[ $G_DIETPI_SERVICES_DISABLE == 1 ]]
#G_DIETPI_SERVICES_DISABLE=${G_DIETPI_SERVICES_DISABLE:-0}
# Device details
@@ -92,11 +103,7 @@ _EOF_
G_HW_CPUID=$(mawk 'NR==9 {print}' /DietPi/dietpi/.hw_model)
G_DISTRO=$(mawk 'NR==3 {print}' /DietPi/dietpi/.hw_model)
- if (( $G_DISTRO == 3 )); then
-
- G_DISTRO_NAME='jessie'
-
- elif (( $G_DISTRO == 4 )); then
+ if (( $G_DISTRO == 4 )); then
G_DISTRO_NAME='stretch'
@@ -104,15 +111,19 @@ _EOF_
G_DISTRO_NAME='buster'
+ elif (( $G_DISTRO == 6 )); then
+
+ G_DISTRO_NAME='bullseye'
+
fi
fi
- # INIT functions for originating script
- # - Stuff we can't init in main globals/funcs due to /etc/bashrc.d/ load into current session.
+ # Init functions for originating script
+ # - Stuff we can't init in main globals/funcs due to /etc/bashrc.d/ load into login session.
# - Optional input variables:
- # G_INIT_ALLOW_CONCURRENT=1 => Allow concurrent DietPi script execution (default: 0)
- # G_INIT_WAIT_CONCURRENT= => Max time to wait for concurrent execution to exit before user prompt (default: 5)
+ # G_INIT_ALLOW_CONCURRENT=1 = Allow concurrent DietPi script execution (default: 0)
+ # G_INIT_WAIT_CONCURRENT= = Max time to wait for concurrent execution to exit before user prompt (default: 5)
G_INIT(){
# Set G_PROGRAM_NAME to originating command if it was not set by originating script
@@ -159,13 +170,13 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
fi
- # HIERARCHY system for G_DIETPI-NOTIFY 3
+ # HIERARCHY system for G_DIETPI-NOTIFY 3 to reduce highlight or sub script output
disable_error=1 G_CHECK_VALIDINT "$HIERARCHY" 0 && export HIERARCHY=$((HIERARCHY+1)) || export HIERARCHY=0
# Set locale for scripts to prevent incorrect scraping due to translated command outputs
export LC_ALL='en_GB.UTF-8'
- # Declare and trap G_EXIT() as exit function, that runs on EXIT signal, which includes INT (error) and TERM (kill)
+ # Declare exit trap, that runs on EXIT signal, which includes INT (interruption) and TERM (kill)
G_EXIT(){
# - Navigate to /tmp, if we are inside working dir, which is about to be removed
@@ -175,7 +186,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
else
- [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 2 "Failed to navigate to /tmp"
+ [[ $G_DEBUG == 1 ]] && G_DIETPI-NOTIFY 2 'Failed to navigate to /tmp'
fi
@@ -271,11 +282,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
# - $1 = start printing from word number $1
Print_Output_String(){
- if [[ $1 == 1 && $G_PROGRAM_NAME ]]; then
-
- output_string+="\e[90m$G_PROGRAM_NAME | \e[0m"
-
- fi
+ [[ $1 == 1 && $G_PROGRAM_NAME ]] && output_string+="\e[90m$G_PROGRAM_NAME | \e[0m"
local i=0
for ((i=$1; i<${#ainput_string[@]}; i++))
do
@@ -351,7 +358,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
}
# Calculate the amount of output lines and in case move cursor up for correct animation and to allow cleaning the whole output.
- local input_string=$(mawk '{gsub("\\\e[[0-9][;0-9]*m","");print}' <<< "$*") # Remove colour codes
+ local input_string=$(mawk '{gsub("\\\e[[0-9][;0-9]*m","");print}' <<< "${G_PROGRAM_NAME+$G_PROGRAM_NAME | }$*") # Remove colour codes
local screen_width=${G_WHIP_SIZE_X_OVERRIDE:-$(tput cols)} # Use override value in case STDOUT + STDERR are redirected
local output_lines=$(( ( ${#input_string} + 5 ) / $screen_width )) # +5 = [ .... ] - $1
(( $output_lines )) && echo -ne "\e[${output_lines}A"
@@ -406,7 +413,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
elif (( $1 == 3 )); then
Clean_Process_Animation
- if disable_error=1 G_CHECK_VALIDINT $HIERARCHY && (( $HIERARCHY > 0 )); then
+ if disable_error=1 G_CHECK_VALIDINT "$HIERARCHY" 1; then
local status_subfunction="$HIERARCHY "
# > 9 should never occur, however, if it is, lets make it line up regardless
@@ -436,30 +443,24 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
}
# $1 = mode
+ # 2 = Silent check, only returning error code if non-root
# 1 = Kill current script only, excluding the shell.
# else = Exit all linked scripts (kill all)
G_CHECK_ROOT_USER(){
- if [[ $G_CHECK_ROOT_USER_VERIFIED != 1 ]]; then
+ if (( $UID )); then
- if (( $UID )); then
-
- G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "sudo" or "G_SUDO".'
-
- if [[ $1 == 1 ]]; then
-
- kill -INT $$
+ [[ $1 == 2 ]] && return 1
- else
+ G_DIETPI-NOTIFY 1 'Root privileges required. Please run the command with "sudo" or "G_SUDO".'
- exit 1
+ if [[ $1 == 1 ]]; then
- fi
+ kill -INT $$
else
- export G_CHECK_ROOT_USER_VERIFIED=1
- G_DIETPI-NOTIFY 0 'Root access verified.'
+ exit 1
fi
@@ -480,7 +481,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
else
export G_CHECK_ROOTFS_RW_VERIFIED=1
- G_DIETPI-NOTIFY 0 'RootFS R/W access verified.'
fi
@@ -492,13 +492,13 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
# Alias defines
#-----------------------------------------------------------------------------------
# DietPi scripts, moved from /etc/bash.bashrc
- # - sudo command that ensures DietPi-Globals with G_* commands are loaded
+ # - sudo wrapper that ensures DietPi-Globals with G_* commands are loaded
G_SUDO(){ local input=$@; sudo bash -c ". /DietPi/dietpi/func/dietpi-globals && $input"; }
- # - sudo alias that allows running other aliases with "sudo"
- alias sudo='sudo ' # https://github.com/MichaIng/DietPi/issues/424
+ # - sudo alias that allows running other aliases with "sudo": https://github.com/MichaIng/DietPi/issues/424
+ alias sudo='sudo '
# - DietPi programs
- alias dietpi-process_tool='/DietPi/dietpi/dietpi-services' #Leave this in for few versions for end users, due to switchover to dietpi-services
+ alias dietpi-process_tool='/DietPi/dietpi/dietpi-services' # Leave this in for few versions for end users, due to switchover to dietpi-services
alias dietpi-letsencrypt='/DietPi/dietpi/dietpi-letsencrypt'
alias dietpi-autostart='/DietPi/dietpi/dietpi-autostart'
alias dietpi-cron='/DietPi/dietpi/dietpi-cron'
@@ -524,9 +524,6 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
# - 1337 moments ;)
alias 1337='echo Indeed, you are =\)'
- # - Helpers
- #alias dd='dd status=progress ' # needs to be at end...
-
# - Optional DietPi software aliases/functions
[[ -d '/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn' ]] && alias dietpi-nordvpn='/DietPi/dietpi/misc/dietpi-nordvpn'
[[ -f '/opt/retropie/supplementary/emulationstation/emulationstation' ]] && alias emulationstation='/opt/retropie/supplementary/emulationstation/emulationstation'
@@ -534,14 +531,14 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
[[ -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'
- (( $G_DISTRO > 3 )) && [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM'
+ [[ -d $G_FP_DIETPI_USERDATA/sonarr || -d $G_FP_DIETPI_USERDATA/radarr || -d $G_FP_DIETPI_USERDATA/lidarr ]] && alias dietpi-arr_to_RAM='/DietPi/dietpi/misc/dietpi-arr_to_RAM'
# - 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 "$@"; }
#-----------------------------------------------------------------------------------
# Whiptail (Whippy-da-whip-whip-whip tail!)
- # - Automatically detects/processes for G_USER_INPUTS
+ # - Automatically detects/processes for G_INTERACTIVE
#-----------------------------------------------------------------------------------
# Input:
# - G_WHIP_DEFAULT_ITEM | Optional, to set the default selected/menu item or input box entry
@@ -789,7 +786,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
local WHIP_MESSAGE=$@
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
G_WHIP_INIT 0
whiptail --title "$G_PROGRAM_NAME" --msgbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X
@@ -810,7 +807,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
local WHIP_MESSAGE=$@
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
G_WHIP_INIT 0
whiptail --title "$G_PROGRAM_NAME" --scrolltext --msgbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X
@@ -832,7 +829,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
local result=1
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
local WHIP_MESSAGE=$@
G_WHIP_INIT 0
@@ -856,12 +853,12 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
local result=1
unset G_WHIP_RETURNED_VALUE # in case left from last G_WHIP
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
local WHIP_MESSAGE=$@
G_WHIP_INIT 0
- G_WHIP_RETURNED_VALUE=$(whiptail --title "$G_PROGRAM_NAME" --inputbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" --default-item "$G_WHIP_DEFAULT_ITEM" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X "$G_WHIP_DEFAULT_ITEM" 3>&1 1>&2 2>&3; echo $? > /tmp/.G_WHIP_INPUTBOX_RESULT)
- result=$(&1 1>&2 2>&3-; echo $? > /tmp/.G_WHIP_INPUTBOX_RESULT)
+ result=$(&1 1>&2 2>&3)
- local password_1=$(whiptail --title "$G_PROGRAM_NAME" --passwordbox 'Please enter the new password again:' --ok-button "$G_WHIP_BUTTON_OK_TEXT" --nocancel --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X 3>&1 1>&2 2>&3)
+ local password_0=$(whiptail --title "$G_PROGRAM_NAME" --passwordbox "$WHIP_MESSAGE" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --nocancel --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X 3>&1 1>&2 2>&3-)
+ local password_1=$(whiptail --title "$G_PROGRAM_NAME" --passwordbox 'Please enter the new password again:' --ok-button "$G_WHIP_BUTTON_OK_TEXT" --nocancel --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X 3>&1 1>&2 2>&3-)
if [[ $password_0 && $password_0 == "$password_1" ]]; then
result=$password_0
@@ -925,14 +920,12 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
local result=1
unset G_WHIP_RETURNED_VALUE # in case left from last G_WHIP
- if (( $G_USER_INPUTS )); then
+ if (( $G_INTERACTIVE )); then
local WHIP_MESSAGE=$@
G_WHIP_INIT 1
- G_WHIP_RETURNED_VALUE=$(whiptail --title "$G_PROGRAM_NAME" --menu "$WHIP_MESSAGE" --default-item "$G_WHIP_DEFAULT_ITEM" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X $WHIP_SIZE_Z "${G_WHIP_MENU_ARRAY[@]}" 3>&1 1>&2 2>&3; echo $? > /tmp/.WHIP_MENU_RESULT)
- result=$(&1 1>&2 2>&3-; echo $? > /tmp/.WHIP_MENU_RESULT)
+ result=$(&1 1>&2 2>&3; echo $? > /tmp/.WHIP_CHECKLIST_RESULT)
+ G_WHIP_RETURNED_VALUE=$(whiptail --title "$G_PROGRAM_NAME" --checklist "$WHIP_MESSAGE" --separate-output --default-item "$G_WHIP_DEFAULT_ITEM" --ok-button "$G_WHIP_BUTTON_OK_TEXT" --cancel-button "$G_WHIP_BUTTON_CANCEL_TEXT" --backtitle "$WHIP_BACKTITLE" $WHIP_SIZE_Y $WHIP_SIZE_X $WHIP_SIZE_Z "${G_WHIP_CHECKLIST_ARRAY[@]}" 3>&1 1>&2 2>&3-; echo $? > /tmp/.WHIP_CHECKLIST_RESULT)
G_WHIP_RETURNED_VALUE=$(echo -e "$G_WHIP_RETURNED_VALUE" | tr '\n' ' ')
- result=$( | Command name for print out
+ # - G_ERROR_HANDLER_EXITCODE= | Commands exit code
+ # Optional input:
+ # - G_ERROR_HANDLER_NO_FAIL=1 | Always report a success, regardless of the exit code | G_INTERACTIVE=0 is not required for this
+ # - G_ERROR_HANDLER_INFO_ONLY=1 | Only print info and retry options, no exit or bug report, sets G_ERROR_HANDLER_ONERROR_EXIT=0 automatically
+ # - G_ERROR_HANDLER_ONERROR_EXIT=0 | Do not exit the script on error
+ # - G_ERROR_HANDLER_RETRY=1 | Allow to retry the command. Requires loop in originating script!
+ # - G_ERROR_HANDLER_ONERROR_FPLOGFILE= | File path to commands logfile, if available
+ # - l_message | Alternative text to print on success, less cryptic for end user
+ # Output:
+ # - G_ERROR_HANDLER_EXITCODE_RETURN= | Contains $G_ERROR_HANDLER_EXITCODE, but is not destroyed during G_ERROR_HANDLER_RESET(), allowing us to call afterwards
# Runs automatically after G_ERROR_HANDLER to reset vars to default
G_ERROR_HANDLER_RESET(){
G_ERROR_HANDLER_EXITCODE_RETURN=$G_ERROR_HANDLER_EXITCODE
- # Delete if used:
+ # Delete logfile if used
[[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE && -f $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]] && rm $G_ERROR_HANDLER_ONERROR_FPLOGFILE
- # unset originating program
- unset G_ERROR_HANDLER_EXITCODE
- unset G_ERROR_HANDLER_COMMAND
-
- unset G_ERROR_HANDLER_NO_FAIL
- unset G_ERROR_HANDLER_INFO_ONLY
- unset G_ERROR_HANDLER_ONERROR_EXIT
- unset G_ERROR_HANDLER_ONERROR_FPLOGFILE
- unset G_ERROR_HANDLER_RETRY
-
- G_ERROR_HANDLER_EXITCODE=0
- G_ERROR_HANDLER_COMMAND=''
-
- G_ERROR_HANDLER_NO_FAIL=0
- G_ERROR_HANDLER_INFO_ONLY=0
- G_ERROR_HANDLER_ONERROR_EXIT=1
- G_ERROR_HANDLER_ONERROR_FPLOGFILE=''
- G_ERROR_HANDLER_RETRY=0
+ # Clear variables
+ unset G_ERROR_HANDLER_COMMAND G_ERROR_HANDLER_EXITCODE
+ unset G_ERROR_HANDLER_NO_FAIL G_ERROR_HANDLER_INFO_ONLY G_ERROR_HANDLER_ONERROR_EXIT
+ unset G_ERROR_HANDLER_RETRY G_ERROR_HANDLER_ONERROR_FPLOGFILE l_message
}
- # Handles exit code errors, as defined by G_ERROR_HANDLER_xxxx settings
- # Usage: G_RUN_CMD dothis
+ # Handles exit code errors, as defined by G_ERROR_HANDLER_* settings
G_ERROR_HANDLER(){
[[ $l_message ]] || local l_message=$G_ERROR_HANDLER_COMMAND
# Ok
(( $G_ERROR_HANDLER_NO_FAIL )) && G_ERROR_HANDLER_EXITCODE=0
- if (( ! $G_ERROR_HANDLER_EXITCODE )); then
+ if ! (( $G_ERROR_HANDLER_EXITCODE )); then
G_DIETPI-NOTIFY 0 "$l_message"
G_ERROR_HANDLER_RESET
@@ -1067,20 +1046,14 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
# Error
else
+ (( $G_ERROR_HANDLER_INFO_ONLY )) && G_ERROR_HANDLER_ONERROR_EXIT=0
+
local send_bugreport=0
local bugreport_id='N/A'
-
- if (( $G_ERROR_HANDLER_INFO_ONLY )); then
-
- G_ERROR_HANDLER_ONERROR_EXIT=0
-
- fi
-
local version_info="v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC ($G_GITOWNER/$G_GITBRANCH)"
-
local print_hw_info="DietPi version: $version_info | HW_MODEL:$G_HW_MODEL | HW_ARCH:$G_HW_ARCH | DISTRO:$G_DISTRO"
- local image_creator='n/a'
- local preimage_name='n/a'
+ local image_creator='N/A'
+ local preimage_name='N/A'
if [[ -r '/DietPi/dietpi/.prep_info' ]]; then
image_creator=$(mawk 'NR==1 {print}' /DietPi/dietpi/.prep_info)
@@ -1089,85 +1062,56 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
fi
- 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'
+ local logfile_content='N/A'
+ [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]] && logfile_content=$(tail -50 $G_ERROR_HANDLER_ONERROR_FPLOGFILE)
+ local print_report_to_dietpi_info='If problems persist, please report at https://github.com/MichaIng/DietPi/issues for investigation.'
local print_unable_to_continue="Unable to continue, $G_PROGRAM_NAME will now terminate."
G_DIETPI-NOTIFY 1 "$G_ERROR_HANDLER_COMMAND"
- # Display "please report to dietpi", if its one of our programs
- if [[ $G_PROGRAM_NAME && ! $G_ERROR_HANDLER_INFO_ONLY ]]; then
-
- G_DIETPI-NOTIFY 2 "$print_report_to_dietpi_info"
-
- fi
-
- # - On Error: Display whip version?
- if (( $G_USER_INPUTS )); then
+ # Display "please report to dietpi", if it's one of our programs
+ [[ $G_PROGRAM_NAME && $G_ERROR_HANDLER_INFO_ONLY != 1 ]] && G_DIETPI-NOTIFY 2 "$print_report_to_dietpi_info"
- local whip_msg=()
- if [[ $G_PROGRAM_NAME ]]; then
+ # If interactive, prompt whip message
+ if (( $G_INTERACTIVE )); then
- whip_msg+="$G_PROGRAM_NAME: $G_ERROR_HANDLER_COMMAND"
+ local whip_msg="${G_PROGRAM_NAME+$G_PROGRAM_NAME: }$G_ERROR_HANDLER_COMMAND
+ - Exit code: $G_ERROR_HANDLER_EXITCODE
+ - $print_hw_info
+ - Image creator: $image_creator
+ - Pre-image: $preimage_name"
- else
-
- whip_msg+=$G_ERROR_HANDLER_COMMAND
-
- fi
+ # Display logfile if available
+ [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]] && whip_msg+="\n\nLog file content:\n$logfile_content"
- whip_msg+="\n - Exit code: $G_ERROR_HANDLER_EXITCODE"
- whip_msg+="\n - $print_hw_info"
- whip_msg+="\n - Image creator: $image_creator"
- whip_msg+="\n - Pre-image: $preimage_name"
- whip_msg+='\n\n'
-
- # Display optional logfile?
- if [[ $G_ERROR_HANDLER_ONERROR_FPLOGFILE ]]; then
-
- whip_msg+=$print_logfile_info
- whip_msg+='\n\n'
-
- fi
-
- # Display "please report to dietpi", if its one of our programs
- if [[ $G_PROGRAM_NAME && ! $G_ERROR_HANDLER_INFO_ONLY ]]; then
-
- whip_msg+=$print_report_to_dietpi_info
-
- fi
+ # Display "please report to dietpi", if its one of our programs
+ [[ $G_PROGRAM_NAME && $G_ERROR_HANDLER_INFO_ONLY != 1 ]] && whip_msg+="\n\n$print_report_to_dietpi_info"
- if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then
-
- whip_msg+='\n\n'
- whip_msg+=$print_unable_to_continue
-
- fi
+ [[ $G_ERROR_HANDLER_ONERROR_EXIT != 0 ]] && whip_msg+="\n\n$print_unable_to_continue"
if (( $G_ERROR_HANDLER_RETRY )); then
G_ERROR_HANDLER_RETRY=0
- local aretry_menu_options=()
- local retry_menu_options_count=0
- aretry_menu_options+=('Retry' ': Re-run the last command that failed'); ((retry_menu_options_count++))
+ local aretry_menu_options=('Retry' ': Re-run the last command that failed')
+ local retry_menu_options_count=1
- if ! ps aux | grep -qi '[d]ietpi-config' && (( ! $G_ERROR_HANDLER_INFO_ONLY )); then
+ if ! pgrep -cf 'dietpi-config' &> /dev/null && [[ $G_ERROR_HANDLER_INFO_ONLY != 1 ]]; then
aretry_menu_options+=('DietPi-Config' ': Edit network, APT/NTP mirror settings etc'); ((retry_menu_options_count++))
fi
- if [[ $G_PROGRAM_NAME && ! $G_ERROR_HANDLER_INFO_ONLY ]]; then
+ if [[ $G_PROGRAM_NAME && $G_ERROR_HANDLER_INFO_ONLY != 1 ]]; then
aretry_menu_options+=('Send report' ': Uploads bugreport containing system info to DietPi'); ((retry_menu_options_count++))
fi
- local no_button_text='Ignore'
- (( $G_ERROR_HANDLER_ONERROR_EXIT )) && no_button_text='Exit'
+ local no_button_text='Exit'
+ [[ $G_ERROR_HANDLER_ONERROR_EXIT == 0 ]] && no_button_text='Ignore'
- local choice=$(whiptail --title 'DietPi Error Handler:' --menu "$whip_msg" --cancel-button "$no_button_text" --scrolltext 24 90 $retry_menu_options_count "${aretry_menu_options[@]}" 3>&1 1>&2 2>&3)
+ local choice=$(whiptail --title 'DietPi Error Handler:' --menu "$whip_msg" --cancel-button "$no_button_text" --scrolltext 24 90 $retry_menu_options_count "${aretry_menu_options[@]}" 3>&1 1>&2 2>&3-)
if (( $? == 0 )); then
if [[ $choice == 'Retry' ]]; then
@@ -1188,15 +1132,13 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
fi
- unset aretry_menu_options
-
else
whiptail --title 'DietPi Error Handler:' --msgbox "$whip_msg" --scrolltext 22 85
fi
- # - No user inputs, disable retry
+ # If non-interactive, never retry
else
G_ERROR_HANDLER_RETRY=0
@@ -1204,25 +1146,25 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
fi
# GitHub printout
- if (( ! $G_ERROR_HANDLER_INFO_ONLY )); then
+ if [[ $G_ERROR_HANDLER_INFO_ONLY != 1 ]]; then
echo -e "
\e[41m
---------------------------------------------------------------------
-- DietPi has encounted an error, and, is unable to continue -
+---------------------------------------------------------------------
+- DietPi has encounted an error, and, is unable to continue -
- Please create a ticket: https://github.com/MichaIng/DietPi/issues -
-- Copy and paste the BLUE lines below, into the ticket -
---------------------------------------------------------------------
+- Copy and paste the BLUE lines below, into the ticket -
+---------------------------------------------------------------------
\e[0m
\e[44m
#### Details:
- Date | $(date)
- Bug report | $bugreport_id
- DietPi version | $version_info
-- Img creator | $image_creator
+- Image creator | $image_creator
- Pre-image | $preimage_name
- SBC device | $G_HW_MODEL_DESCRIPTION (index=$G_HW_MODEL)
-- Kernel version | $(uname -v)
+- Kernel version | $(uname -a)
- Distro | $G_DISTRO_NAME (index=$G_DISTRO)
- Command | $G_ERROR_HANDLER_COMMAND
- Exit code | $G_ERROR_HANDLER_EXITCODE
@@ -1234,7 +1176,7 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
2. ...
#### Expected behaviour:
-
+
- ...
#### Actual behaviour:
@@ -1247,25 +1189,25 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')"; then
#### Additional logs:
\`\`\`
-$print_logfile_info
+$logfile_content
\`\`\`
\e[0m
-\e[41m--------------------------------------------------------------------\e[0m
+\e[41m---------------------------------------------------------------------\e[0m
" > /tmp/.G_ERROR_HANDLER_GITREPORT
fi
if (( $send_bugreport )); then
- # - Send automated bug report
- killall -w dietpi-bugreport &> /dev/null
+ # Send automated bug report
+ killall -qw dietpi-bugreport &> /dev/null
/DietPi/dietpi/dietpi-bugreport 1
fi
- # - End
- if (( ! $G_ERROR_HANDLER_RETRY )); then
+ # End
+ if [[ $G_ERROR_HANDLER_RETRY != 1 ]]; then
if [[ -f '/tmp/.G_ERROR_HANDLER_GITREPORT' ]]; then
@@ -1274,11 +1216,11 @@ $print_logfile_info
fi
- if (( $G_ERROR_HANDLER_ONERROR_EXIT )); then
+ if [[ $G_ERROR_HANDLER_ONERROR_EXIT != 0 ]]; then
G_DIETPI-NOTIFY 1 "$print_unable_to_continue"
G_ERROR_HANDLER_RESET
- # - Kill current script, excluding shell
+ # Kill current script, excluding shell
kill -INT $$
else
@@ -1333,7 +1275,7 @@ $print_logfile_info
# - $optional_cmd_inputs (eg: --no-check-certificate)
# - G_CHECK_URL_TIMEOUT to override default and dietpi.txt set timeout
# - G_CHECK_URL_ATTEMPTS to override default and dietpi.txt set attempts
- # In case of failure and $G_USER_INPUTS=1: Prompts user to configure network
+ # In case of failure and $G_INTERACTIVE=1: Prompts user to configure network
G_CHECK_URL(){
local url=$@
@@ -1504,8 +1446,7 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
local string=$@
- local options=''
- (( $G_DISTRO > 3 )) && options='--allow-change-held-packages'
+ local options='--allow-change-held-packages'
G_ERROR_HANDLER_RETRY=1
while (( $G_ERROR_HANDLER_RETRY ))
@@ -1536,8 +1477,7 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
local string=$@
- local options=''
- (( $G_DISTRO > 3 )) && options='--allow-change-held-packages'
+ local options='--allow-change-held-packages'
G_ERROR_HANDLER_RETRY=1
while (( $G_ERROR_HANDLER_RETRY ))
@@ -1546,12 +1486,12 @@ $print_logfile_info
G_ERROR_HANDLER_COMMAND="G_AGP $string"
G_ERROR_HANDLER_ONERROR_FPLOGFILE=$G_FP_LOG_APT
- # - Create list of matching installed packages
- local packages=$(dpkg --get-selections $string 2> /dev/null | mawk '{print $1}')
+ G_DIETPI-NOTIFY 2 "\e[0mAPT removal for: \e[33m$string\e[0m, please wait..."
+ # - Create one-lined list of matching installed packages, abort if none were found
+ local packages=$(dpkg --get-selections $string 2> /dev/null | mawk '{print $1}' ORS=' ')
if [[ $packages ]]; then
- G_DIETPI-NOTIFY 2 "\e[0mAPT removal for: \e[33m$packages\e[0m, please wait..."
echo -ne '\e[90m'
DEBIAN_FRONTEND=noninteractive apt-get -qq $options purge $packages 2>&1 | tee $G_FP_LOG_APT
G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]}
@@ -1604,6 +1544,8 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
+ local options='--allow-change-held-packages'
+
G_ERROR_HANDLER_RETRY=1
while (( $G_ERROR_HANDLER_RETRY ))
do
@@ -1614,7 +1556,7 @@ $print_logfile_info
G_DIETPI-NOTIFY 2 '\e[0mAPT fix, please wait...'
echo -ne '\e[90m'
- DEBIAN_FRONTEND=noninteractive apt-get -qq -f install 2>&1 | tee $G_FP_LOG_APT
+ DEBIAN_FRONTEND=noninteractive apt-get -qq $options -f install 2>&1 | tee $G_FP_LOG_APT
G_ERROR_HANDLER_EXITCODE=${PIPESTATUS[0]}
G_ERROR_HANDLER
@@ -1686,8 +1628,7 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
- local options=''
- (( $G_DISTRO > 3 )) && options='--allow-change-held-packages'
+ local options='--allow-change-held-packages'
G_ERROR_HANDLER_RETRY=1
while (( $G_ERROR_HANDLER_RETRY ))
@@ -1717,35 +1658,30 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
- local fp_temp='/tmp/.G_AG_CHECK_INSTALL_PREREQ'
local exit_code=0
local string=$@
- local packages_to_install=''
-
- G_DIETPI-NOTIFY 2 "Checking for pre-req APT packages: \e[33m$string"
+ local i packages
- dpkg --get-selections > $fp_temp
- local i=0
- for i in $string; do
+ G_DIETPI-NOTIFY 2 "Checking for required APT packages: \e[33m$string"
- if ! grep -qi "^$i[[:space:]]" $fp_temp; then
-
- G_DIETPI-NOTIFY 2 "Flagged for installation: \e[33m$i"
- packages_to_install+=" $i"
+ for i in $string
+ do
- fi
+ dpkg-query -s "$i" &> /dev/null && continue
+ G_DIETPI-NOTIFY 2 "Flagged for install: \e[33m$i"
+ packages+=" $i"
done
- rm $fp_temp
- if [[ $packages_to_install ]]; then
+ if [[ $packages ]]; then
- G_AGI $packages_to_install
+ G_AGUP
+ G_AGI $packages
exit_code=$?
else
- G_DIETPI-NOTIFY 2 'Pre-req APT packages were already installed'
+ G_DIETPI-NOTIFY 0 'All required APT packages are already installed.'
fi
@@ -1780,22 +1716,20 @@ $print_logfile_info
}
# Returns current CPU temp 'C
- # print_full_info=1 # optional input to print full colour text output and temp warnings.
+ # - print_full_info=1 Optional input to print full colour text output and temp warnings
G_OBTAIN_CPU_TEMP(){
- local cpu_temp_current='N/A' # We must always return a value, due to VM lacking this feature + benchmark online
- [[ $print_full_info == [01] ]] || local print_full_info=0
-
# Read CPU temp from file
+ local temp
# - Sparky/Asus: Requires special case as in others array this would break other SBC temp readouts with 2 zones
if (( $G_HW_MODEL == 70 || $G_HW_MODEL == 52 )); then
- cpu_temp_current=$(= 150 )) && cpu_temp_current=$(mawk '{print $1/1000}' <<< $cpu_temp_current | xargs printf "%0.0f")
+ # 2/5 digit output?
+ (( $temp >= 150 )) && temp=$(mawk '{print $1/1000}' <<< $temp | xargs printf "%0.0f")
- if (( $print_full_info )); then
+ if [[ $print_full_info == 1 ]]; then
- local cpu_temp_current_f=$(( $cpu_temp_current * 9/5 + 32 ))
- if (( $cpu_temp_current >= 70 )); then
+ local temp_f=$(( $temp * 9/5 + 32 ))
+ if (( $temp >= 70 )); then
- cpu_temp_current="\e[1;31mWARNING: $cpu_temp_current'C : $cpu_temp_current_f'F (Reducing the life of your device)\e[0m"
+ temp="\e[1;31mWARNING: $temp'C : $temp_f'F (Reducing the life of your device)\e[0m"
- elif (( $cpu_temp_current >= 60 )); then
+ elif (( $temp >= 60 )); then
- cpu_temp_current="\e[38;5;202m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running hot, not recommended)\e[0m"
+ temp="\e[38;5;202m$temp'C : $temp_f'F \e[90m(Running hot, not recommended)\e[0m"
- elif (( $cpu_temp_current >= 50 )); then
+ elif (( $temp >= 50 )); then
- cpu_temp_current="\e[1;33m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Running warm, but safe)\e[0m"
+ temp="\e[1;33m$temp'C : $temp_f'F \e[90m(Running warm, but safe)\e[0m"
- elif (( $cpu_temp_current >= 40 )); then
+ elif (( $temp >= 40 )); then
- cpu_temp_current="\e[1;32m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Optimal temperature)\e[0m"
+ temp="\e[1;32m$temp'C : $temp_f'F \e[90m(Optimal temperature)\e[0m"
- elif (( $cpu_temp_current >= 30 )); then
+ elif (( $temp >= 30 )); then
- cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Cool runnings)\e[0m"
+ temp="\e[1;36m$temp'C : $temp_f'F \e[90m(Cool runnings)\e[0m"
else
- cpu_temp_current="\e[1;36m$cpu_temp_current'C : $cpu_temp_current_f'F\e[90m (Who put me in the freezer!)\e[0m"
+ temp="\e[1;36m$temp'C : $temp_f'F \e[90m(Who put me in the freezer!)\e[0m"
fi
@@ -1858,25 +1792,24 @@ $print_logfile_info
fi
- echo -e "$cpu_temp_current"
+ echo -e "$temp"
}
# Returns current CPU usage %
G_OBTAIN_CPU_USAGE(){
- # - PS (inaccurate, but fast??)
+ # 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
+ while read -r line
+ do
- cpu_usage=$(echo "scale=1;$cpu_usage + $line" | bc -l)
+ cpu_usage=$(bc -l <<< "scale=1;$cpu_usage + $line")
- done < "$fp_temp"
+ done <<< "$(ps -eo %cpu | sed -n '1!{s/^ //p}')"
- # - ps returns usage of each core, so we devide the total by #n cores
- cpu_usage=$(echo "scale=1;$cpu_usage / $G_HW_CPU_CORES" | bc -l)
+ # ps returns usage of each core, so we devide the total by #n cores
+ cpu_usage=$(bc -l <<< "scale=1;$cpu_usage / $G_HW_CPU_CORES")
echo $cpu_usage
@@ -1991,28 +1924,23 @@ $print_logfile_info
# 0=ok
G_CHECK_USERDATA(){
- return_value=0
-
+ local return_value=0
local fp_actual=$G_FP_DIETPI_USERDATA
- #Symlinked?
+ # Symlinked?
if [[ -L $G_FP_DIETPI_USERDATA ]]; then
- # - Check psyhical location exists and is mounted
+ # Check psyhical location exists and is mounted
fp_actual=$(readlink -f $G_FP_DIETPI_USERDATA)
- if ! df -P $fp_actual &> /dev/null; then
-
- return_value=1
-
- fi
+ df -P $fp_actual &> /dev/null || return_value=1
fi
G_DIETPI-NOTIFY $return_value "DietPi-Userdata validation: $fp_actual"
- if (( $return_value >= 1 )); then
+ if (( $return_value )); then
- G_WHIP_MSG "Error: DietPi-Userdata validation\n\nDietPi was unable to verify the existance of the userdata directory ($fp_actual).\n\nPlease ensure all previous external drives are connected and functional, before trying again.\n\nUnable to continue, exiting."
- kill -INT $$ #kill all current scripts, excluding shell.
+ G_WHIP_MSG "[FAILED] DietPi-Userdata validation\n\nDietPi was unable to verify the existance of the userdata directory ($fp_actual).\n\nPlease ensure all previous external drives are connected and functional, before trying again.\n\nUnable to continue, exiting."
+ kill -INT $$ # kill all current scripts, excluding shell
fi
@@ -2033,7 +1961,7 @@ $print_logfile_info
local exit_code=$?
G_DIETPI-NOTIFY -1 $exit_code 'DietPi-Backup'
- if (( $exit_code != 0 )); then
+ if (( $exit_code )); then
# - Kill current scripts, excluding shell
G_WHIP_MSG 'DietPi-Backup was unable to complete sucessfully. To avoid issues, the current program will now be terminated.\n - logfile = /var/log/dietpi-backup.log'
@@ -2093,7 +2021,7 @@ $print_logfile_info
#-----------------------------------------------------------------------------------
# Not yet compatible with dietpi global commands. single bash commands only with no error handling.
G_THREADING_ENABLED=${G_THREADING_ENABLED:-1}
-
+
G_THREAD_START(){
# - Launch as BG process
@@ -2104,7 +2032,7 @@ $print_logfile_info
G_THREAD_COMMAND[$G_THREAD_COUNT]=$@
echo -1337 > /tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT
- { { G_USER_INPUTS=0 ${G_THREAD_COMMAND[$G_THREAD_COUNT]} &> /tmp/.G_THREAD_COMMAND_$G_THREAD_COUNT; echo $? > /tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT; } & disown; } &> /dev/null
+ { { G_INTERACTIVE=0 ${G_THREAD_COMMAND[$G_THREAD_COUNT]} &> /tmp/.G_THREAD_COMMAND_$G_THREAD_COUNT; echo $? > /tmp/.G_THREAD_EXITCODE_$G_THREAD_COUNT; } & disown; } &> /dev/null
G_DIETPI-NOTIFY 2 "G_THREAD_START_$G_THREAD_COUNT | ${G_THREAD_COMMAND[$G_THREAD_COUNT]}"
@@ -2187,13 +2115,13 @@ $print_logfile_info
G_CHECK_ROOT_USER 1
- export G_USER_INPUTS=0
+ export G_INTERACTIVE=0
/DietPi/dietpi/dietpi-backup -1
G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /DietPi/dietpi.txt
/DietPi/dietpi/dietpi-update -1
/DietPi/dietpi/dietpi-backup 1
- unset G_USER_INPUTS
+ unset G_INTERACTIVE
}
@@ -2210,7 +2138,7 @@ $print_logfile_info
G_DEV_BENCH(){
echo 1 > /DietPi/dietpi/.dietpi-survey
- G_USER_INPUTS=0 /DietPi/dietpi/func/dietpi-benchmark 2
+ G_INTERACTIVE=0 /DietPi/dietpi/func/dietpi-benchmark 2
}
diff --git a/dietpi/func/dietpi-led_control b/dietpi/func/dietpi-led_control
index 46229ad2db..043125fd54 100644
--- a/dietpi/func/dietpi-led_control
+++ b/dietpi/func/dietpi-led_control
@@ -64,7 +64,6 @@
for ((i=0; i<${#aLED_NAME[@]}; i++))
do
-
echo "${aLED_SETTING_CURRENT[$i]}" > "/sys/class/leds/${aLED_NAME[$i]}/trigger"
if (( $? == 0 )); then
diff --git a/dietpi/func/dietpi-logclear b/dietpi/func/dietpi-logclear
index f7c94eded9..fe71380c83 100644
--- a/dietpi/func/dietpi-logclear
+++ b/dietpi/func/dietpi-logclear
@@ -16,36 +16,27 @@
# - dietpi-logclear 2 | Delete all logs in $FILEPATH_LOGFOLDER and backups.
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Logclear'
G_CHECK_ROOT_USER
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- INPUT=-1
- disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1
+ disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=-1
#////////////////////////////////////////////////////////////////
# Global
#////////////////////////////////////////////////////////////////
- TEMP_FILE='dietpi-logclear'
-
FILEPATH_LOGFOLDER='/var/log'
- FILEPATH_BACKUPFOLDER="$HOME/logfile_storage"
+ FILEPATH_BACKUPFOLDER='/root/logfile_storage'
FILE_NAME=''
- #0=text log, 1=compressed, 2=Pi-hole
+ # 0=text log, 1=compressed
FILE_TYPE=0
FILESIZE_BYTES=0
PROCESS_FILE=0
- #////////////////////////////////////////////////////////////////
- #Excluded log files (user created)
- #////////////////////////////////////////////////////////////////
- FP_EXCLUDED_LOGFILES='/DietPi/dietpi/.dietpi-logclear_exclude'
- INFO_EXCLUDED_LOGFILES=0
-
#////////////////////////////////////////////////////////////////
# Info Printouts
#////////////////////////////////////////////////////////////////
@@ -62,155 +53,83 @@
Process_Logfiles(){
#-----------------------------------------------------------------------------------
- #Remove internally rotated LetsEncrypt log files, prior to log loop
+ # Remove internally rotated LetsEncrypt log files, prior to log loop
[[ -d $FILEPATH_LOGFOLDER/letsencrypt ]] && rm -f $FILEPATH_LOGFOLDER/letsencrypt/letsencrypt.log.*
#-----------------------------------------------------------------------------------
- #Find existing logs and generate a filepath list.
- find $FILEPATH_LOGFOLDER -type f > $TEMP_FILE
+ # Find existing logs and generate a filepath array, excluding symlinks
+ local ARRAY_LOG_FILEPATH=()
+ while read -r line
+ do
+
+ ARRAY_LOG_FILEPATH+=("$line")
- #Read logfile filepath list into array.
- readarray -t ARRAY_LOG_FILEPATH < $TEMP_FILE
+ done <<< "$(find $FILEPATH_LOGFOLDER -type f)"
#-----------------------------------------------------------------------------------
- #Process Logfiles
+ # Process Logfiles
for ((i=0; i<${#ARRAY_LOG_FILEPATH[@]}; i++))
do
- #File details
- FILE_NAME=${ARRAY_LOG_FILEPATH[$i]//\/var\/log\/}
+ # File details
+ FILE_NAME=${ARRAY_LOG_FILEPATH[$i]#/var/log/}
FILESIZE_BYTES=$(stat -c%s "${ARRAY_LOG_FILEPATH[$i]}")
PROCESS_FILE=1
FILE_TYPE=0
- #Special Filetypes
- #Pi-hole logs (contains dns stats) | FILE_TYPE 2
- if [[ ${ARRAY_LOG_FILEPATH[$i]} == '/var/log/pihole.log' ]]; then
-
- FILE_TYPE=2
-
- #Compessed files (zip etc) | FILE_TYPE 1
- elif [[ ${FILE_NAME: -4} == '.zip' || ${FILE_NAME: -3} == '.gz' ]]; then
+ # Filetypes
+ # - Compessed files (zip etc) | FILE_TYPE 1
+ if [[ ${FILE_NAME: -4} == '.zip' || ${FILE_NAME: -3} == '.gz' ]]; then
FILE_TYPE=1
- #Normal Log Files.
- # - Exclude <= 10 byte size
- # - Exclude .db* extentions SQLite (.db .db-shm .db.wal)
- elif (( $FILESIZE_BYTES <= 10 )) || [[ $FILE_NAME =~ '.db' ]]; then
+ # - Normal Log Files
+ # Exclude <= 10 byte size
+ # Exclude .db* extentions SQLite (.db .db-shm .db.wal)
+ elif (( $FILESIZE_BYTES < 11 )) || [[ $FILE_NAME =~ '.db' ]]; then
PROCESS_FILE=0
fi
- #Process File
+ # Process File
if (( $PROCESS_FILE == 1 )); then
- #Pi-hole
- if (( $FILE_TYPE == 2 )); then
-
- local pihole_restart_required=0
-
- #Find all non-matching lines with todays date
- # NB: day is space padded without trailling 0 (eg: Sep 1, Sep 11)
- local month_day_today="$(date +'%b %e')"
-
- # - Check for at least 1 non-matching line before applying. Remove all lines in logfile for all other days, excluding today.
- if grep -vqi "$month_day_today" /var/log/pihole.log; then
-
- # RAMlog mode 2:
- if (( $INPUT == 0 )); then
-
- sed "/$month_day_today/d" "${ARRAY_LOG_FILEPATH[$i]}" >> "$FILEPATH_BACKUPFOLDER/$FILE_NAME"
- ((INFO_BACKUPS_MADE++))
-
- fi
-
- G_DIETPI-NOTIFY 2 'Clearing log entries for Pi-hole, that are not from today, please wait...'
- sed -i '/'"$month_day_today"'/!d' /var/log/pihole.log
- pihole_restart_required=1
-
- fi
-
- # recheck size again
- FILESIZE_BYTES=$(stat -c%s "${ARRAY_LOG_FILEPATH[$i]}")
-
- #Clear all entries if over (AUTO_SETUP_RAMLOG_MAXSIZE / 3) (we have to limit and prevent /var/log hitting the 50mb tmpfs limit)
- local filesize_limit=$(( ( $(grep -m1 '^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') / 3 ) * 1024 * 1024 ))
- if (( $FILESIZE_BYTES >= $filesize_limit )); then
-
- G_DIETPI-NOTIFY 2 "${ARRAY_LOG_FILEPATH[$i]} has exceeded ${filesize_limit}MB, clearing, please wait..."
-
- # RAMlog mode 2:
- if (( $INPUT == 0 )); then
-
- cat "${ARRAY_LOG_FILEPATH[$i]}" >> "$FILEPATH_BACKUPFOLDER/$FILE_NAME"
- ((INFO_BACKUPS_MADE++))
-
- fi
-
- > "${ARRAY_LOG_FILEPATH[$i]}"
- ((INFO_LOGS_CLEARED++))
-
- pihole_restart_required=1
-
- #Prevent size effecting results
- else
-
- FILESIZE_BYTES=0
-
- fi
-
- #restart PiHole if we modified the log file
- if (( $pihole_restart_required )); then
-
- G_DIETPI-NOTIFY 2 'PiHole logs have been changed, restarting, please wait...'
- systemctl stop pihole-FTL
- # Handle dnsmasq only, if enabled (+installed), otherwise assume FTLDNS, which would be broken by dnsmasq start: https://github.com/MichaIng/DietPi/issues/1696
- systemctl is-enabled dnsmasq 2> /dev/null | grep -q '^enabled$' && systemctl stop dnsmasq
- systemctl stop resolvconf
- sleep 1
- systemctl start resolvconf
- systemctl is-enabled dnsmasq 2> /dev/null | grep -q '^enabled$' && systemctl start dnsmasq
- systemctl start pihole-FTL
-
- fi
-
- #Delete all compressed filetypes.
- elif (( $FILE_TYPE == 1 )); then
+ # Delete all compressed filetypes
+ if (( $FILE_TYPE == 1 )); then
rm "${ARRAY_LOG_FILEPATH[$i]}"
((INFO_LOGS_DELETED++))
((INFO_LOGS_NOTSUPPORTED++))
- #Update current log files data to $FILEPATH_BACKUPFOLDER/*. Then clear.
+ # Update current log files data to $FILEPATH_BACKUPFOLDER/*, then clear
elif (( $INPUT == 0 )); then
- #Generate filepaths
+ # Generate filepaths
if [[ ! -f $FILEPATH_BACKUPFOLDER/$FILE_NAME ]]; then
- #This is a little "hack" to automatically generate the required subdirectories.
+ # This is a little "hack" to automatically generate the required subdirectories.
# EG: /this/is/my/logfile.txt | will create the folders /this/is/my
mkdir -p "$FILEPATH_BACKUPFOLDER/$FILE_NAME"
rm -R "$FILEPATH_BACKUPFOLDER/$FILE_NAME"
fi
- #Write current logfile contents to existing.
+ # Write current logfile contents to existing.
cat "${ARRAY_LOG_FILEPATH[$i]}" >> "$FILEPATH_BACKUPFOLDER/$FILE_NAME"
((INFO_BACKUPS_MADE++))
- #Clear logfile contents
+ # Clear logfile contents
> "${ARRAY_LOG_FILEPATH[$i]}"
((INFO_LOGS_CLEARED++))
- #Clear logfile contents
+ # Clear logfile contents
elif (( $INPUT == 1 )); then
> "${ARRAY_LOG_FILEPATH[$i]}"
((INFO_LOGS_CLEARED++))
- #Hard delete log files
+ # Hard delete log files
elif (( $INPUT == 2 )); then
rm "${ARRAY_LOG_FILEPATH[$i]}"
@@ -218,7 +137,7 @@
fi
- #Update Size cleared.
+ # Update Size cleared
INFO_SIZE_CLEARED=$(($INFO_SIZE_CLEARED + $FILESIZE_BYTES))
fi
@@ -227,12 +146,6 @@
done
- #Remove temp files
- rm $TEMP_FILE
-
- #delete[] array
- unset ARRAY_LOG_FILEPATH
-
}
#////////////////////////////////////////////////////////////////
@@ -240,61 +153,46 @@
#////////////////////////////////////////////////////////////////
#----------------------------------------------------------------
- #How to use print.
- if (( $INPUT == -1 )); then
-
- G_DIETPI-NOTIFY 2 'Available commands:'
- echo ''
- 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"
- echo ''
- echo -e '\e[1m dietpi-logclear 1\e[0m'
- echo -e "\e[38;5;244m Clear contents of all logs files in $FILEPATH_LOGFOLDER.\e[0m"
- echo ''
- echo -e '\e[1m dietpi-logclear 2\e[0m'
- echo -e "\e[38;5;244m Physically delete all files in $FILEPATH_LOGFOLDER and backups in $FILEPATH_BACKUPFOLDER/*.\n May prevent log files from being updated, restart services or reboot. \e[0m"
- echo ''
+ # Print usage
+ if (( $INPUT > 2 || $INPUT < 0 )); then
+
+ G_DIETPI-NOTIFY 2 "Available commands:\e[0m
+\n\e[1m dietpi-logclear 0\e[0m
+\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
+\n\e[1m dietpi-logclear 1\e[0m
+\e[38;5;244m Clear contents of all logs files in $FILEPATH_LOGFOLDER.\e[0m
+\n\e[1m dietpi-logclear 2\e[0m
+\e[38;5;244m Physically delete all files in $FILEPATH_LOGFOLDER and backups in $FILEPATH_BACKUPFOLDER/*.\n May prevent log files from being updated, restart services or reboot.\e[0m\n"
#----------------------------------------------------------------
- #Process log files
- elif (( $INPUT >= 0 )); then
+ # Process log files
+ else
Process_Logfiles
- #Delete logfile backups
- (( $INPUT == 2 )) && rm -R $FILEPATH_BACKUPFOLDER &> /dev/null
-
- #Print Info
- 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"
-
- #Excluded
- echo -e " - Excluded files \e[90m|\e[0m $INFO_EXCLUDED_LOGFILES"
-
- #Cleared
- echo -e " - Cleared log files \e[90m|\e[0m $INFO_LOGS_CLEARED"
-
- #Deleted
- echo -e " - Unsupported files \e[90m|\e[0m $INFO_LOGS_NOTSUPPORTED"
- echo -e " - Deleted files \e[90m|\e[0m $INFO_LOGS_DELETED"
+ # Delete logfile backups
+ [[ $INPUT == 2 && -f $FILEPATH_BACKUPFOLDER ]] && rm -R $FILEPATH_BACKUPFOLDER
- #convert size to kb
- #/= (i miss it)
- INFO_SIZE_CLEARED=$(($INFO_SIZE_CLEARED / 1024))
- echo -e " - Space cleared \e[90m|\e[0m $INFO_SIZE_CLEARED KB"
+ # Print Info
+ info="
+ - Log file directory \e[90m|\e[0m $FILEPATH_LOGFOLDER
+ - Processed files \e[90m|\e[0m $INFO_FILES_PROCESSED
+ - Cleared log files \e[90m|\e[0m $INFO_LOGS_CLEARED
+ - Unsupported files \e[90m|\e[0m $INFO_LOGS_NOTSUPPORTED
+ - Deleted files \e[90m|\e[0m $INFO_LOGS_DELETED
+ - Space cleared \e[90m|\e[0m $(($INFO_SIZE_CLEARED / 1024)) KiB"
- #Backups
+ # + Backups
if (( $INPUT == 0 )); then
- echo ''
- echo -e ' \e[38;5;244mBackup Info:\e[0m'
- echo -e " - Backup directory \e[90m|\e[0m $FILEPATH_BACKUPFOLDER"
- echo -e " - Updated log files \e[90m|\e[0m $INFO_BACKUPS_MADE"
+ info+="
+ \e[38;5;244mBackup Info:\e[0m
+ - Backup directory \e[90m|\e[0m $FILEPATH_BACKUPFOLDER
+ - Updated log files \e[90m|\e[0m $INFO_BACKUPS_MADE"
fi
- echo ''
+ G_DIETPI-NOTIFY 2 "\e[0mSummary:$info\n"
fi
diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model
index 1c16fb317b..ea92da53ad 100644
--- a/dietpi/func/dietpi-obtain_hw_model
+++ b/dietpi/func/dietpi-obtain_hw_model
@@ -12,11 +12,11 @@
# - Called from /DietPi/dietpi/preboot
#
# In DietPi-Software: Need to match highest values in dietpi-obtain_hw_model
- # MAX_G_HW_MODEL=72
- # MAX_G_HW_ARCH=10
- # MAX_G_DISTRO=5
+ # - MAX_G_HW_MODEL=72
+ # - MAX_G_HW_ARCH=10
+ # - MAX_G_DISTRO=6
#
- # - Line1 -
+ # ---- Line 1 ----
# G_HW_MODEL 72 ROCK Pi 4
# G_HW_MODEL 71 Beagle Bone Black
# G_HW_MODEL 70 Sparky SBC
@@ -51,7 +51,7 @@
# 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 20 VM x64 (VMware, VirtualBox, Hyper-V, ...)
# G_HW_MODEL 15 Odroid N2
# G_HW_MODEL 14 Odroid N1
# G_HW_MODEL 13 Odroid U3
@@ -63,56 +63,51 @@
# 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 -
+ # ---- Line 2 ----
# G_HW_MODEL_DESCRIPTION
- # - Line3 -
- # G_DISTRO 0 unknown
- # G_DISTRO 1 Debian Wheezy (No longer supported, https://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!
+ # ---- Line 3 ----
+ # G_DISTRO 0 unknown/unsupported
+ # G_DISTRO 1 Debian Wheezy (No longer supported: https://dietpi.com/phpbb/viewtopic.php?p=1898)
+ # G_DISTRO 2 Ubuntu 14.04 (No longer supported)
+ # G_DISTRO 3 Jessie (No longer supported: https://github.com/MichaIng/DietPi/issues/2332)
+ # G_DISTRO 4 Stretch
# G_DISTRO 5 Buster
- # - Line4 -
- # RootFS device path (eg: /dev/mmc01)
- # - Line5 -
+ # G_DISTRO 6 Bullseye
+ # ---- Line 4 ----
+ # RootFS device path (eg: /dev/mmcblk0p1)
+ # ---- Line 5 ----
# UUID
- # - Line 6 -
- # G_HW_ARCH 10 x86_64 (VM)
+ # ---- Line 6 ----
+ # G_HW_ARCH 10 x86_64
# G_HW_ARCH 3 armv8/arm64
# G_HW_ARCH 2 armv7
# G_HW_ARCH 1 armv6
- # G_HW_ARCH 0 unknown
- # - Line 7 -
+ # G_HW_ARCH 0 unsupported
+ # ---- Line 7 ----
# G_HW_ARCH_DESCRIPTION
- # - Line 8 -
+ # ---- Line 8 ----
# IMAGE_ADDITIONAL_CREDITS (eg: Meveric)
- # - Line 9 - Group CPU's
+ # ---- Line 9 ---- Group CPUs
# G_HW_CPUID 0 Not set
# G_HW_CPUID 1 H3
# G_HW_CPUID 2 H5
# G_HW_CPUID 3 RK3399
# G_HW_CPUID 4 S922X
- # - Line 10 - Onboard WiFi/BT Index
+ # ---- Line 10 ---- Onboard WiFi/BT Index
# HW_ONBOARD_WIFI 0 Not set
- # HW_ONBOARD_WIFI 1 RPi3/ZeroW (BCM43438)
- # - Line 11 - (RPi only)
+ # HW_ONBOARD_WIFI 1 RPi3/4/ZeroW (BCM43438)
+ # ---- Line 11 ---- (RPi only)
# HW_MEMORY_SIZE
- # - Line 12 - (RPi only)
+ # ---- Line 12 ---- (RPi only)
# HW_REVISION_CODE
- # - Line 13 - (RPi only)
+ # ---- Line 13 ---- (RPi only)
# HW_RELEASE_DATEH
- # - Line 14 - (RPi only)
+ # ---- Line 14 ---- (RPi only)
# W_PCB_REVISION_CODE
- # - Line 15 - (RPi only)
+ # ---- Line 15 ---- (RPi only)
# HW_MANUFACTURER_NAME
#////////////////////////////////////
- # Import DietPi-Globals --------------------------------------------------------------
- #. /DietPi/dietpi/func/dietpi-globals # Not required
- #export LC_ALL=en_GB.UTF-8 # No locale dependant output scrape
- #cd /tmp # No tmp file creation
- # Import DietPi-Globals --------------------------------------------------------------
-
#/////////////////////////////////////////////////////////////////////////////////////
# Obtain Hardware Model index
#/////////////////////////////////////////////////////////////////////////////////////
@@ -122,7 +117,7 @@
G_HW_MODEL=-1
G_HW_MODEL_DESCRIPTION='Unknown Device'
G_DISTRO=0
- ROOTFS_DEVICE_PATH=$(df --output=source / | tail -1)
+ ROOTFS_DEVICE_PATH=$(findmnt -no SOURCE /)
HW_UUID=0
G_HW_ARCH=0
G_HW_ARCH_DESCRIPTION=$(uname -m)
@@ -140,7 +135,7 @@
RPi_BoardInfo(){
#-----------------------------------------------------------------------------------
- # Obtain device info by revision number: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+ # Obtain device info by revision code: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
# - Release dates: https://www.elinux.org/RPi_HardwareHistory
# - *' because 10000002 then it indicates that your Raspberry Pi has been over-volted
HW_REVISION_CODE=$(mawk '/^Revision/ {print $3;exit}' /proc/cpuinfo)
@@ -526,6 +521,7 @@
[[ $HW_REVISION_CODE == *'c03111' ]] && HW_MEMORY_SIZE=4096
HW_MANUFACTURER_NAME='Sony, UK'
G_HW_MODEL=4
+ HW_ONBOARD_WIFI=1
fi
@@ -544,6 +540,7 @@
if (( $G_HW_MODEL == 72 )); then
G_HW_MODEL_DESCRIPTION='ROCK Pi 4'
+ G_HW_CPUID=3
# Beagle Bone Black
elif (( $G_HW_MODEL == 71 )); then
@@ -656,7 +653,7 @@
G_HW_MODEL_DESCRIPTION='OrangePi PC Plus'
G_HW_CPUID=1
- # PineA64
+ # Pine A64
elif (( $G_HW_MODEL == 40 )); then
G_HW_MODEL_DESCRIPTION='Pine A64'
@@ -713,7 +710,7 @@
G_HW_MODEL_DESCRIPTION='OrangePi One'
G_HW_CPUID=1
- # OrangePi Pc
+ # OrangePi PC
elif (( $G_HW_MODEL == 30 )); then
G_HW_MODEL_DESCRIPTION='OrangePi PC'
@@ -784,11 +781,7 @@
fi
# Get distro index
- if grep -qi 'jessie' /etc/os-release; then
-
- G_DISTRO=3
-
- elif grep -qi 'stretch' /etc/os-release; then
+ if grep -qi 'stretch' /etc/os-release; then
G_DISTRO=4
@@ -796,6 +789,10 @@
G_DISTRO=5
+ elif grep -qi 'bullseye' /etc/os-release; then
+
+ G_DISTRO=6
+
fi
# Generate UUID if it does not exist
@@ -803,6 +800,10 @@
HW_UUID=$(mawk 'NR==5 {print}' /DietPi/dietpi/.hw_model)
+ elif [[ -f '/boot/dietpi/.hw_model' ]]; then
+
+ HW_UUID=$(mawk 'NR==5 {print}' /boot/dietpi/.hw_model)
+
else
HW_UUID=$( | Tests using the provided URL/IP
#////////////////////////////////////
- #Grab Input
- URL='www.google.com'
- [[ $1 ]] && URL="$1"
-
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Optimal_MTU'
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
+
+ # Check for ping
+ command -v ping &> /dev/null || { G_DIETPI-NOTIFY 1 '"ping" command is missing, please install e.g. via "apt install iputils-ping". Aborting...'; exit 1; }
+
+ # Grab and test input URL
+ URL='dietpi.com'
+ [[ $1 ]] && URL=$1
+ if ping -c 1 "$URL" &> /dev/null; then
+
+ G_DIETPI-NOTIFY 2 "Finding optimal MTU size with test URL/IP $URL, please wait..."
+
+ else
+
+ G_DIETPI-NOTIFY 1 "Pinging test URL/IP $URL failed. Please verify spelling and that this host is online. Aborting..."
+ exit 1
+
+ fi
# Start with system default value
MTU_SIZE=1500
#-----------------------------------------------------------------------------------
- G_DIETPI-NOTIFY 0 "DietPi - MTU optimal size tool. Finding optimal MTU size ($URL), please wait..."
while :
do
- G_DIETPI-NOTIFY 2 "Testing MTU: $MTU_SIZE"
- # Remove IPv4 icmp headers from total size
- if ! ping -c 1 -s $(( $MTU_SIZE - 28 )) -M do $URL | grep -qi '+1 error'; then
+ G_DIETPI-NOTIFY -2 "Testing MTU size: $MTU_SIZE"
+ # Remove IPv4 ICMP headers from total size
+ if ping -c 1 -s $(( $MTU_SIZE - 28 )) -M do "$URL" &> /dev/null; then
- G_DIETPI-NOTIFY 0 "MTU optimal size = $MTU_SIZE"
+ G_DIETPI-NOTIFY 0 "Optimal MTU size = $MTU_SIZE"
break
- elif (( $MTU_SIZE <= 0 )); then
+ elif (( $MTU_SIZE < 29 )); then
- G_DIETPI-NOTIFY 1 'Failed to find MTU size'
+ G_DIETPI-NOTIFY 1 'Failed to find optimal MTU size'
break
- else
-
- ((MTU_SIZE--))
-
fi
+ ((MTU_SIZE--))
+
done
#-----------------------------------------------------------------------------------
diff --git a/dietpi/func/dietpi-set_cpu b/dietpi/func/dietpi-set_cpu
index 4c115374b1..bfd9561efc 100644
--- a/dietpi/func/dietpi-set_cpu
+++ b/dietpi/func/dietpi-set_cpu
@@ -14,14 +14,14 @@
# - Sets CPU governor user prefs | throttle up percent etc
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-CPU_set'
G_CHECK_ROOT_USER
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- #Exit path for VM
+ # Exit path for VM
if (( $G_HW_MODEL == 20 )); then
echo -e '\nNotice: CPU Governors are not available for VM.\n'
@@ -29,14 +29,11 @@
fi
- CPU_GOVERNOR=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_GOVERNOR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- CPU_MAX_FREQ=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_MAX_FREQ=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- CPU_MIN_FREQ=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_MIN_FREQ=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- CPU_DISABLE_TURBO=$(grep -m1 '^[[:blank:]]*CONFIG_CPU_DISABLE_TURBO=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ CPU_GOVERNOR=$(sed -n '/^[[:blank:]]*CONFIG_CPU_GOVERNOR=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
Check_GPU_Gov_Available(){
- #Check if target Gov is available on system.
+ # Check if target Gov is available on system
if ! grep -qi $CPU_GOVERNOR /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors; then
G_DIETPI-NOTIFY 1 "CPU gov: $CPU_GOVERNOR, not supported by kernel"
@@ -57,7 +54,7 @@
G_DIETPI-NOTIFY 2 "Switching to CPU gov: $CPU_GOVERNOR"
- # - Update dietpi.txt
+ # Update dietpi.txt
G_CONFIG_INJECT 'CONFIG_CPU_GOVERNOR=' "CONFIG_CPU_GOVERNOR=$CPU_GOVERNOR" /DietPi/dietpi.txt
fi
@@ -70,7 +67,7 @@
local input_core_start=$2
local input_core_end=$3
- #Apply the Gov
+ # Apply the Gov
for ((i=$input_core_start; i<$input_core_end; i++))
do
@@ -78,106 +75,114 @@
done
- #Apply CPU max/min frequency
- # - Intel based 0-100%:
- if [[ -f /sys/devices/system/cpu/intel_pstate/max_perf_pct ]]; then
+ # Apply CPU max/min frequency
+ # - Only on non-RPi
+ if (( $G_HW_MODEL > 9 )); then
- disable_error=1 G_CHECK_VALIDINT "$CPU_MAX_FREQ" || CPU_MAX_FREQ=100
- disable_error=1 G_CHECK_VALIDINT "$CPU_MIN_FREQ" || CPU_MIN_FREQ=25
+ local cpu_max_freq=$(sed -n '/^[[:blank:]]*CONFIG_CPU_MAX_FREQ=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local cpu_min_freq=$(sed -n '/^[[:blank:]]*CONFIG_CPU_MIN_FREQ=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
- echo $CPU_MAX_FREQ > /sys/devices/system/cpu/intel_pstate/max_perf_pct
- echo $CPU_MIN_FREQ > /sys/devices/system/cpu/intel_pstate/min_perf_pct
+ # Intel based 0-100%
+ if [[ -f '/sys/devices/system/cpu/intel_pstate/max_perf_pct' ]]; then
- G_DIETPI-NOTIFY 2 "Applied CPU Frequency Limits : Max = $CPU_MAX_FREQ % | Min = $CPU_MIN_FREQ %"
+ disable_error=1 G_CHECK_VALIDINT "$cpu_max_freq" 1 100 || cpu_max_freq=100
+ disable_error=1 G_CHECK_VALIDINT "$cpu_min_freq" 1 100 || cpu_min_freq=25
- if [[ -f /sys/devices/system/cpu/intel_pstate/no_turbo ]]; then
+ echo $cpu_max_freq > /sys/devices/system/cpu/intel_pstate/max_perf_pct
+ echo $cpu_min_freq > /sys/devices/system/cpu/intel_pstate/min_perf_pct
- echo $CPU_DISABLE_TURBO > /sys/devices/system/cpu/intel_pstate/no_turbo
- G_DIETPI-NOTIFY 2 "Applied Turbo Mode : $CPU_DISABLE_TURBO (1=disabled)"
+ G_DIETPI-NOTIFY 2 "Applied CPU Frequency Limits : Max = $cpu_max_freq % | Min = $cpu_min_freq %"
- fi
+ if [[ -f '/sys/devices/system/cpu/intel_pstate/no_turbo' ]]; then
- # - Standard via kernel (Hz)
- elif [[ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq ]]; then
+ if grep -qi '^[[:blank:]]*CONFIG_CPU_DISABLE_TURBO=1' /DietPi/dietpi.txt; then
- # Reset to defaults if no/invalid entry
- local converted_hz_value_max=-1 #-1 indicates reset CPU freqs
- local converted_hz_value_min=-1 #-1 indicates reset CPU freqs
- if disable_error=1 G_CHECK_VALIDINT "$CPU_MAX_FREQ"; then
+ echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
+ G_DIETPI-NOTIFY 2 'Disabled Intel Turbo Mode'
- converted_hz_value_max=$(( $CPU_MAX_FREQ * 1000 ))
+ else
- fi
+ echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
+ G_DIETPI-NOTIFY 2 'Enabled Intel Turbo Mode'
- if disable_error=1 G_CHECK_VALIDINT "$CPU_MIN_FREQ"; then
+ fi
- converted_hz_value_min=$(( $CPU_MIN_FREQ * 1000 ))
+ fi
- fi
+ # Standard via kernel (MHz)
+ elif [[ -f '/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq' ]]; then
- G_DIETPI-NOTIFY 2 "Setting CPU freq: Max = $CPU_MAX_FREQ MHz | Min = $CPU_MIN_FREQ"
- for ((i=$input_core_start; i<$input_core_end; i++))
- do
+ # Reset to defaults if no/invalid entry
+ local converted_hz_value_max=-1 # -1 indicates reset CPU freqs
+ local converted_hz_value_min=-1 # -1 indicates reset CPU freqs
+ disable_error=1 G_CHECK_VALIDINT "$cpu_max_freq" && converted_hz_value_max=$(( $cpu_max_freq * 1000 ))
+ disable_error=1 G_CHECK_VALIDINT "$cpu_min_freq" && converted_hz_value_min=$(( $cpu_min_freq * 1000 ))
- if (( $converted_hz_value_min > 0 )); then
+ G_DIETPI-NOTIFY 2 "Setting CPU freq: Max = $cpu_max_freq kHz | Min = $cpu_min_freq kHz"
+ for ((i=$input_core_start; i<$input_core_end; i++))
+ do
- echo $converted_hz_value_min > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_min_freq
+ if (( $converted_hz_value_min > 0 )); then
- else
+ echo $converted_hz_value_min > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_min_freq
- mawk '{print $1}' /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_frequencies > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_min_freq
+ else
- fi
+ mawk '{print $1}' /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_frequencies > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_min_freq
- if (( $converted_hz_value_max > 0 )); then
+ fi
- echo $converted_hz_value_max > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
+ if (( $converted_hz_value_max > 0 )); then
- else
+ echo $converted_hz_value_max > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
- mawk '{print $NF}' /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_frequencies > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
+ else
- fi
+ mawk '{print $NF}' /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_available_frequencies > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
+
+ fi
+
+ done
- done
+ fi
fi
- local cpu_throttle_up_percent=$(grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' /DietPi/dietpi.txt | sed 's/.*=//')
+ local cpu_throttle_up_percent=$(sed -n '/^[[:blank:]]*CONFIG_CPU_USAGE_THROTTLE_UP=/{s/[^=]*=//p;q}' /DietPi/dietpi.txt)
- #Set CPU governor interactive settings
- if [[ $input_gov_name == interactive ]]; then
+ # Set CPU governor interactive settings
+ if [[ $input_gov_name == 'interactive' ]]; then
- #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
+ # 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
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
- #Set CPU governor ondemand settings
- elif [[ $input_gov_name == ondemand ]]; then
+ # Set CPU governor ondemand settings
+ elif [[ $input_gov_name == 'ondemand' ]]; then
- local cpu_ondemand_sampling_rate=$(grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_RATE=' /DietPi/dietpi.txt | sed 's/.*=//')
- local cpu_ondemand_sampling_down_factor=$(grep -m1 '^CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=' /DietPi/dietpi.txt | sed 's/.*=//')
+ local cpu_ondemand_sampling_rate=$(sed -n '/^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_RATE=/{s/[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local cpu_ondemand_sampling_down_factor=$(sed -n '/^[[:blank:]]*CONFIG_CPU_ONDEMAND_SAMPLE_DOWNFACTOR=/{s/[^=]*=//p;q}' /DietPi/dietpi.txt)
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
- if [[ -f /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ]]; then
+ # Check for different possible locations
+ # - All
+ if [[ -f '/sys/devices/system/cpu/cpufreq/ondemand/up_threshold' ]]; then
echo $cpu_throttle_up_percent > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $cpu_ondemand_sampling_rate > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo $cpu_ondemand_sampling_down_factor > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
- # XU4 3.x kernel
+ # - XU4 3.x kernel
else
- # Apply to all cores
+ # Apply to all cores
for ((i=$input_core_start; i<$input_core_end; i++))
do
@@ -189,12 +194,10 @@
fi
- #Set CPU governor conservative settings
- elif [[ $input_gov_name == conservative ]]; then
-
- cpu_throttle_up_percent=$(grep -m1 '^CONFIG_CPU_USAGE_THROTTLE_UP=' /DietPi/dietpi.txt | sed 's/.*=//')
+ # Set CPU governor conservative settings
+ elif [[ $input_gov_name == 'conservative' ]]; then
- #XU3/4 different path (must apply to each core)
+ # 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++))
@@ -222,7 +225,7 @@
#-----------------------------------------------------------------------------------
Check_GPU_Gov_Available
- #Apply CPU0 gov to all cores (if required)
+ # Apply CPU0 gov to all cores (if required)
Apply_CPU_Gov $CPU_GOVERNOR 0 $G_HW_CPU_CORES
G_DIETPI-NOTIFY 0 "CPU gov applied: $CPU_GOVERNOR\n"
diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware
index 135735c6f9..f92f613464 100644
--- a/dietpi/func/dietpi-set_hardware
+++ b/dietpi/func/dietpi-set_hardware
@@ -29,8 +29,7 @@ $FP_SCRIPT gpumemsplit 64/128/256 # RPi only
$FP_SCRIPT rpi-camera enable/disable
$FP_SCRIPT rpi-opengl vc4-kms-v3d/vc4-fkms-v3d/disable
$FP_SCRIPT rpi3_usb_boot enable
-"
- #////////////////////////////////////
+" #////////////////////////////////////
# Grab Inputs
INPUT_DEVICE_NAME=${1,,}
@@ -62,7 +61,7 @@ $FP_SCRIPT rpi3_usb_boot enable
[[ -f $FP_RPI_CONFIG ]] || FP_RPI_CONFIG='/boot/config.txt'
# ARMbian uses armbianEnv.txt instead which requires different syntax
- elif [[ -f /boot/armbianEnv.txt ]]; then
+ elif [[ -f '/boot/armbianEnv.txt' ]]; then
ARMBIAN=1
FP_UENV='/boot/armbianEnv.txt'
@@ -119,29 +118,23 @@ $FP_SCRIPT rpi3_usb_boot enable
if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
- # - Enable RPi Camera module
- G_CONFIG_INJECT 'start_x=' 'start_x=1' $FP_RPI_CONFIG
-
- # - v4l2 module (motioneye /dev/video0)
- G_CONFIG_INJECT 'bcm2835-v4l2' 'bcm2835-v4l2' /etc/modules
-
- local gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024/{s/^[^=]*=//p;q}' $FP_RPI_CONFIG)
- # - requires 128MB memory split min.
- if (( ${gpu_mem:-0} < 128 )); then
+ # Remove modules blacklist
+ [[ -f '/etc/modprobe.d/dietpi-disable_rpi_camera.conf' ]] && rm /etc/modprobe.d/dietpi-disable_rpi_camera.conf
- local tmp=$INPUT_DEVICE_VALUE
- INPUT_DEVICE_VALUE=128
-
- Gpu_Memory_Split_Main
-
- INPUT_DEVICE_VALUE=$tmp
+ # Enable video devices via extended start
+ G_CONFIG_INJECT 'start_x=' 'start_x=1' $FP_RPI_CONFIG
- fi
+ # Requires 128 MiB memory split at least
+ local gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem[_0-9]*=/{s/^[^=]*=//p;q}' $FP_RPI_CONFIG)
+ (( ${gpu_mem:-0} < 128 )) && INPUT_DEVICE_VALUE=128 Gpu_Memory_Split_Main
elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then
- G_CONFIG_INJECT 'start_x=' 'start_x=0' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*bcm2835-v4l2/d' /etc/modules
+ # Comment extended start setting
+ sed -i '/^[[:blank:]]*start_x=/c\#start_x=1' $FP_RPI_CONFIG
+
+ # Add modules blacklist, which are otherwise loaded by default since kernel 4.19
+ echo -e 'blacklist bcm2835_codec\nblacklist bcm2835_v4l2' > /etc/modprobe.d/dietpi-disable_rpi_camera.conf
else
@@ -156,7 +149,7 @@ $FP_SCRIPT rpi3_usb_boot enable
#/////////////////////////////////////////////////////////////////////////////////////
RPi_USB_Boot_Main(){
- (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi
+ [[ $G_HW_MODEL == 3 && $G_HW_MODEL_DESCRIPTION != *'+'* ]] || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi3 nonplus
if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
@@ -188,7 +181,6 @@ _EOF_
systemctl disable dietpi-rm_program_usb_boot_mode
rm /etc/systemd/system/dietpi-rm_program_usb_boot_mode.service
- systemctl daemon-reload
fi
@@ -237,29 +229,19 @@ _EOF_
# RPi
if (( $G_HW_MODEL < 10 )); then
- # - Framebuffer dimensions should not play a role here, but
- # if NOT set, they appear as "0" by asking "vcgencmd get_config (max_)?framebuffer_(width|height)"
- # otherwise vcgencmd shows the set value. So we simply comment it.
- sed -i '/^[[:blank:]]*framebuffer_width=/c\#framebuffer_width=0' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*framebuffer_height=/c\#framebuffer_height=0' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*max_framebuffer_width=/c\#max_framebuffer_width=0' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*max_framebuffer_height=/c\#max_framebuffer_height=0' $FP_RPI_CONFIG
+ # Apply lowest possible framebuffer size
+ G_CONFIG_INJECT 'framebuffer_width=' 'framebuffer_width=16' $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'framebuffer_height=' 'framebuffer_height=16' $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'max_framebuffer_width=' 'max_framebuffer_width=16' $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'max_framebuffer_height=' 'max_framebuffer_height=16' $FP_RPI_CONFIG
# - Splash cannot be seen anyway without video output
G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' $FP_RPI_CONFIG
# - hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen
G_CONFIG_INJECT 'hdmi_blanking=' 'hdmi_blanking=1' $FP_RPI_CONFIG
# - Disable HDMI hotplug detection, which requires it to be generally responsive/active
G_CONFIG_INJECT 'hdmi_ignore_hotplug=' 'hdmi_ignore_hotplug=1' $FP_RPI_CONFIG
- # - Disable composite hotplug, which then allows to completely disable the video pipeline + framebuffer
- G_CONFIG_INJECT 'hdmi_ignore_composite=' 'hdmi_ignore_composite=1' $FP_RPI_CONFIG
-
- # Odroid C1
- #REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "0"' /DietPi/boot.ini
- G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "0"' /DietPi/boot.ini
- G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini
+ # - Disable SDTV on RPi4
+ sed -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' $FP_RPI_CONFIG
# Odroid C2
elif (( $G_HW_MODEL == 12 )); then
@@ -272,21 +254,20 @@ _EOF_
fi
+ G_CONFIG_INJECT 'AUTO_SETUP_HEADLESS=' 'AUTO_SETUP_HEADLESS=1' /DietPi/dietpi.txt
+
elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then
# RPi
if (( $G_HW_MODEL < 10 )); then
- sed -i '/^[[:blank:]]*hdmi_ignore_hotplug=/c\#hdmi_ignore_hotplug=0' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*hdmi_ignore_composite=/c\#hdmi_ignore_composite=0' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*framebuffer_width=/c\#framebuffer_width=16' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*framebuffer_height=/c\#framebuffer_height=16' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*max_framebuffer_width=/c\#max_framebuffer_width=16' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*max_framebuffer_height=/c\#max_framebuffer_height=16' $FP_RPI_CONFIG
sed -i '/^[[:blank:]]*hdmi_blanking=/c\#hdmi_blanking=0' $FP_RPI_CONFIG
-
- # Odroid C1: REMOVE v6.24
- elif (( $G_HW_MODEL == 10 && $G_DISTRO == 3 )); then
-
- G_CONFIG_INJECT 'setenv hdmioutput ' 'setenv hdmioutput "1"' /DietPi/boot.ini
- G_CONFIG_INJECT 'setenv vpu ' 'setenv vpu "1"' /DietPi/boot.ini
- G_CONFIG_INJECT 'setenv m_bpp ' 'setenv m_bpp "32"' /DietPi/boot.ini
+ sed -i '/^[[:blank:]]*hdmi_ignore_hotplug=/c\#hdmi_ignore_hotplug=0' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' $FP_RPI_CONFIG
# Odroid C2
elif (( $G_HW_MODEL == 12 )); then
@@ -299,6 +280,8 @@ _EOF_
fi
+ G_CONFIG_INJECT 'AUTO_SETUP_HEADLESS=' 'AUTO_SETUP_HEADLESS=0' /DietPi/dietpi.txt
+
else
Unknown_Input_Mode
@@ -312,30 +295,25 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
RemoteIR_Prereqs(){ G_AG_CHECK_INSTALL_PREREQ lirc; }
- RemoteIR_Reset_All(){
+ RemoteIR_Reset(){
# Disable JustBoom
if (( $G_HW_MODEL < 10 )); then
if [[ -f '/etc/systemd/system/justboom-ir-mpd.service' ]]; then
- systemctl stop justboom-ir-mpd
- systemctl disable justboom-ir-mpd
+ systemctl disable --now justboom-ir-mpd
rm /etc/systemd/system/justboom-ir-mpd.service
- systemctl daemon-reload
fi
- sed -i '/^[[:blank:]]*dtoverlay=lirc-rpi/d' $FP_RPI_CONFIG
- sed -i '/^[[:blank:]]*dtparam=gpio_in_pin=25/d' $FP_RPI_CONFIG
+ sed -i '/^[[:blank:]]*dtoverlay=gpio-ir/d' $FP_RPI_CONFIG
# Disable Odroids
elif (( $G_HW_MODEL < 20 )) && [[ -f '/etc/systemd/system/odroid-remote.service' ]]; then
- systemctl stop odroid-remote
- systemctl disable odroid-remote
+ systemctl disable --now odroid-remote
rm /etc/systemd/system/odroid-remote.service
- systemctl daemon-reload
fi
@@ -345,12 +323,13 @@ _EOF_
(( $G_HW_MODEL > 19 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-Odroid/non-RPi
+ RemoteIR_Reset
+
if [[ $INPUT_DEVICE_VALUE == 'odroid_remote' ]]; then
(( $G_HW_MODEL < 10 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid
RemoteIR_Prereqs
- RemoteIR_Reset_All
# XU4 Cloudshell
if (( $G_HW_MODEL == 11 )); then
@@ -362,8 +341,7 @@ _EOF_
G_CONFIG_INJECT 'gpioplug-ir-recv' 'gpioplug-ir-recv' /etc/modules
# C2
- elif (( $G_HW_MODEL == 12 ||
- ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24
+ elif (( $G_HW_MODEL == 12 )); then
# - Module
G_CONFIG_INJECT 'meson_ir' 'meson_ir' /etc/modules
@@ -372,37 +350,7 @@ _EOF_
# All
# - systemd
- if (( $G_DISTRO < 4 )); then
-
- if [[ -f '/etc/init.d/lirc' ]]; then
-
- systemctl disable lirc
- rm /etc/init.d/lirc
- systemctl daemon-reload
-
- fi
-
- cat << _EOF_ > /etc/systemd/system/odroid-remote.service
-[Unit]
-Description=Odroid Remote C1/C2/XU4
-
-[Service]
-Type=forking
-ExecStartPre=$(command -v mkdir) -p /run/lirc
-ExecStart=$(command -v lircd) --output=/run/lirc/lircd --driver=default --device=/dev/lirc0 --uinput
-
-[Install]
-WantedBy=multi-user.target
-_EOF_
- systemctl daemon-reload
- systemctl enable odroid-remote
-
- # Since Stretch a systemd service exists
- else
-
- systemctl enable lircd
-
- fi
+ systemctl enable lircd
# - Lircd conf for Odroid Remote
cat << _EOF_ > /etc/lirc/lircd.conf
@@ -447,10 +395,8 @@ _EOF_
(( $G_HW_MODEL > 9 )) && { Unsupported_Input_Mode; return 1; } # Exit path for non-RPi
RemoteIR_Prereqs
- RemoteIR_Reset_All
- G_CONFIG_INJECT 'dtoverlay=lirc-rpi' 'dtoverlay=lirc-rpi' $FP_RPI_CONFIG
- G_CONFIG_INJECT 'dtparam=gpio_in_pin=' 'dtparam=gpio_in_pin=25' $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'dtoverlay=gpio-ir' 'dtoverlay=gpio-ir,gpio_pin=25' $FP_RPI_CONFIG
cat << _EOF_ > /etc/lirc/hardware.conf
LIRCD_ARGS="--uinput"
@@ -566,14 +512,9 @@ ExecStart=$(command -v irexec)
WantedBy=default.target
_EOF_
systemctl daemon-reload
- systemctl enable justboom-ir-mpd
- systemctl start justboom-ir-mpd
-
- elif [[ $INPUT_DEVICE_VALUE == 'none' ]]; then
-
- RemoteIR_Reset_All
+ systemctl enable --now justboom-ir-mpd
- else
+ elif [[ $INPUT_DEVICE_VALUE != 'none' ]]; then
Unknown_Input_Mode
@@ -605,17 +546,14 @@ ExecStart=$(command -v ethtool) -s $eth_adapter speed $eth_force_speed duplex fu
WantedBy=ifup@$eth_adapter.service
_EOF_
systemctl daemon-reload
- systemctl enable ethtool_force_speed
- systemctl start ethtool_force_speed
+ systemctl enable --now ethtool_force_speed
elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then # 0 is converted to 'disable'
if [[ -f '/etc/systemd/system/ethtool_force_speed.service' ]]; then
- systemctl stop ethtool_force_speed
- systemctl disable ethtool_force_speed
+ systemctl disable --now ethtool_force_speed
rm /etc/systemd/system/ethtool_force_speed.service
- systemctl daemon-reload
fi
@@ -628,7 +566,7 @@ _EOF_
}
#/////////////////////////////////////////////////////////////////////////////////////
- # RPi openGL
+ # RPi OpenGL
#/////////////////////////////////////////////////////////////////////////////////////
RPi_OpenGL_Main(){
@@ -639,14 +577,12 @@ _EOF_
if [[ $INPUT_DEVICE_VALUE == 'vc4-'* ]]; then
- (( $G_HW_MODEL < 2 )) && { Unsupported_Input_Mode; return 1; } # RPi 2/3+ only
-
- # - GL packages
+ # GL packages
G_AG_CHECK_INSTALL_PREREQ libgl1-mesa-dri libgles2-mesa mesa-utils
- echo "dtoverlay=$INPUT_DEVICE_VALUE" >> $FP_RPI_CONFIG
+ G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
- # - Set 1080p by default
+ # Set 1080p by default
G_CONFIG_INJECT 'framebuffer_width=' 'framebuffer_width=1920' $FP_RPI_CONFIG
G_CONFIG_INJECT 'framebuffer_height=' 'framebuffer_height=1080' $FP_RPI_CONFIG
@@ -795,7 +731,7 @@ _EOF_
sed -i '/"SwapAxes"/c\ Option "SwapAxes" "1"' /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf
# - Move fb0 xorg.conf out the way: https://github.com/MichaIng/DietPi/issues/767
- [[ -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]] && mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/99-fbturbo.conf
+ [[ -f '/usr/share/X11/xorg.conf.d/99-fbturbo.conf' ]] && mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/99-fbturbo.conf
# Odroids
else
@@ -870,10 +806,8 @@ _EOF_
if [[ -f '/etc/systemd/system/con2fbmap.service' ]]; then
- systemctl stop con2fbmap
- systemctl disable con2fbmap
+ systemctl disable --now con2fbmap
rm /etc/systemd/system/con2fbmap.service
- systemctl daemon-reload
fi
[[ -f '/etc/modprobe.d/waveshare32.conf' ]] && rm /etc/modprobe.d/waveshare32.conf
@@ -911,7 +845,7 @@ _EOF_
# Odroid LCD 3.5
Lcd_Panel_OdroidLCD35_Enable(){
- (( $G_HW_MODEL >= 10 && $G_HW_MODEL < 20 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid
+ (( $G_HW_MODEL > 9 && $G_HW_MODEL < 20 )) || { Unsupported_Input_Mode; return 1; } # Exit path for non-Odroid
# Reset to disabled:
Lcd_Panel_OdroidLCD35_Disable
@@ -940,12 +874,12 @@ _EOF_
fi
- for i in ${!amodules[@]}
+ for i in ${amodules[@]}
do
# - Enable modules now, as we need to detect pwm path for service
- G_RUN_CMD modprobe ${amodules[$i]}
- G_CONFIG_INJECT "${amodules[$i]}" "${amodules[$i]}" /etc/modules
+ G_RUN_CMD modprobe $i
+ G_CONFIG_INJECT "$i" "$i" /etc/modules
done
@@ -988,9 +922,9 @@ PathExists=/dev/fb2
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=/bin/bash -c 'echo 500000 > $fp_control/freq0'
-ExecStart=/bin/bash -c 'echo 1 > $fp_control/enable0'
-ExecStart=/bin/bash -c 'echo 1023 > $fp_control/duty0'
+ExecStart=/bin/dash -c 'echo 500000 > $fp_control/freq0'
+ExecStart=/bin/dash -c 'echo 1 > $fp_control/enable0'
+ExecStart=/bin/dash -c 'echo 1023 > $fp_control/duty0'
ExecStart=$(command -v setterm) -blank 0 -powersave off
ExecStart=$(command -v con2fbmap) 1 2
StandardOutput=tty
@@ -1033,10 +967,8 @@ _EOF_
[[ -f '/etc/modprobe.d/odroid-lcd35.conf' ]] && rm /etc/modprobe.d/odroid-lcd35.conf
if [[ -f '/etc/systemd/system/odroid-lcd35.service' ]]; then
- systemctl stop odroid-lcd35
- systemctl disable odroid-lcd35
+ systemctl disable --now odroid-lcd35
rm /etc/systemd/system/odroid-lcd35.service
- systemctl daemon-reload
fi
[[ -f '/etc/X11/xorg.conf.d/99-odroid-lcd35.conf' ]] && rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf
@@ -1068,19 +1000,22 @@ _EOF_
elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then
+ # Kernel modules
sed -i '/^[[:blank:]]*i2c-bcm2708/d' /etc/modules
sed -i '/^[[:blank:]]*i2c-dev/d' /etc/modules
+
+ # config.txt
G_CONFIG_INJECT 'dtparam=i2c_arm=' 'dtparam=i2c_arm=off' $FP_RPI_CONFIG
G_CONFIG_INJECT 'dtparam=i2c1=' 'dtparam=i2c1=off' $FP_RPI_CONFIG
- G_CONFIG_INJECT 'i2c_arm_baudrate=' 'i2c_arm_baudrate=100000' $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'dtparam=i2c_arm_baudrate=' 'dtparam=i2c_arm_baudrate=100000' $FP_RPI_CONFIG
- # Set baudrate (khz) | valid int
+ # Set baudrate (kHz) | valid int
elif disable_error=1 G_CHECK_VALIDINT "$INPUT_DEVICE_VALUE" 2 10000000; then
- G_CONFIG_INJECT 'i2c_arm_baudrate=' "i2c_arm_baudrate=$(( $INPUT_DEVICE_VALUE * 1000 ))" $FP_RPI_CONFIG
+ G_CONFIG_INJECT 'dtparam=i2c_arm_baudrate=' "dtparam=i2c_arm_baudrate=$(( $INPUT_DEVICE_VALUE * 1000 ))" $FP_RPI_CONFIG
- # inform user
- INPUT_DEVICE_VALUE+='Khz'
+ # Inform user
+ INPUT_DEVICE_VALUE+=' kHz'
else
@@ -1107,35 +1042,41 @@ _EOF_
)
- [[ -f '/etc/modprobe.d/disable_bt.conf' ]] && rm /etc/modprobe.d/disable_bt.conf
-
- # - Disable
if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then
- # + all Broadcom-based models that need brcm_patchram_plus
- if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then
+ # RPi
+ if (( $G_HW_MODEL < 10 )); then
- systemctl stop brcm_patchram_plus 2> /dev/null
- systemctl disable brcm_patchram_plus 2> /dev/null
+ systemctl disable --now hciuart 2> /dev/null
+ # - Enable dtoverlay only for onboard WiFi/BT models
+ if (( $HW_ONBOARD_WIFI )); then
- # + RPi 3 (apply to all, as pi-bluetooth package is default installed on all RPi's now)
- # + ASUS TB
- elif (( $G_HW_MODEL < 10 || $G_HW_MODEL == 52 )); then
+ G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' $FP_RPI_CONFIG
+ dtoverlay disable-bt
- systemctl stop hciuart 2> /dev/null
- systemctl disable hciuart 2> /dev/null
+ fi
+
+ # ASUS TB
+ elif (( $G_HW_MODEL == 52 )); then
+
+ systemctl disable --now hciuart 2> /dev/null
+
+ # Broadcom-based models that need brcm_patchram_plus
+ elif (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then
+
+ systemctl disable --now brcm_patchram_plus 2> /dev/null
fi
- # Bluetooth last
- systemctl stop bluetooth 2> /dev/null
- systemctl disable bluetooth 2> /dev/null
+ systemctl disable --now bluetooth 2> /dev/null
+ # Unload and blacklist modules, bluetooth last
+ > /etc/modprobe.d/dietpi-disable_bluetooth.conf
for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--))
do
modprobe -rf "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null
- echo "blacklist ${aBLUETOOTH_MODULES[$i]}" >> /etc/modprobe.d/disable_bt.conf
+ echo "blacklist ${aBLUETOOTH_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_bluetooth.conf
done
@@ -1147,9 +1088,11 @@ _EOF_
fi
- # - Enable
elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
+ # Remove module blacklist
+ [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && rm /etc/modprobe.d/dietpi-disable_bluetooth.conf
+
# Pre-Reqs
if (( $G_HW_MODEL < 10 )); then
@@ -1169,6 +1112,10 @@ Do you want to continue and disable the serial login console?'; then
fi
+ # - Remove dtoverlay
+ sed -i '/^[[:blank:]]*dtoverlay=disable-bt/d' $FP_RPI_CONFIG
+ dtoverlay -r disable-bt # In case loaded on same session
+
G_AG_CHECK_INSTALL_PREREQ pi-bluetooth
else
@@ -1178,7 +1125,7 @@ Do you want to continue and disable the serial login console?'; then
fi
- # Bluetooth first
+ # Load modules, bluetooth first
for i in "${aBLUETOOTH_MODULES[@]}"
do
@@ -1186,24 +1133,17 @@ Do you want to continue and disable the serial login console?'; then
done
- # + all Broadcom-based models that need brcm_patchram_plus
+ # Broadcom-based models that need brcm_patchram_plus
if (( $G_HW_MODEL == 61 || $G_HW_MODEL == 62 )); then
- systemctl enable brcm_patchram_plus 2> /dev/null
- G_RUN_CMD systemctl start brcm_patchram_plus
+ G_RUN_CMD systemctl enable --now brcm_patchram_plus
fi
- systemctl enable bluetooth 2> /dev/null
- G_RUN_CMD systemctl start bluetooth
+ G_RUN_CMD systemctl enable --now bluetooth
- # + RPi
- if (( $G_HW_MODEL < 10 )); then
-
- systemctl enable hciuart
- G_RUN_CMD systemctl start hciuart
-
- fi
+ # RPi
+ (( $G_HW_MODEL < 10 )) && G_RUN_CMD systemctl enable --now hciuart
else
@@ -1227,7 +1167,7 @@ Do you want to continue and disable the serial login console?'; then
elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
- [[ -f /etc/sysctl.d/dietpi-disable_ipv6.conf ]] && rm /etc/sysctl.d/dietpi-disable_ipv6.conf
+ [[ -f '/etc/sysctl.d/dietpi-disable_ipv6.conf' ]] && rm /etc/sysctl.d/dietpi-disable_ipv6.conf
# - Apply to current session:
# - "all" => all existing interfaces
# - "default" => all future interfaces
@@ -1313,6 +1253,7 @@ Do you want to continue and disable the serial login console?'; then
Wifi_Modules_Main(){
+ # Estimate module list
# - All
local aWIFI_MODULES=('cfg80211')
@@ -1362,36 +1303,53 @@ Do you want to continue and disable the serial login console?'; then
fi
- # - Disable
+ # APT packages
+ local packages='crda iw rfkill wireless-tools wpasupplicant'
+
if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then
- [[ -f '/etc/modprobe.d/disable_wifi.conf' ]] && rm /etc/modprobe.d/disable_wifi.conf
+ # Disable onboard WiFi as well
+ (( $HW_ONBOARD_WIFI )) && INPUT_DEVICE_VALUE='onboard_disable' Wifi_Modules_Main
+
+ # Reset blacklists and remove powersaving settings
+ > /etc/modprobe.d/dietpi-disable_wifi.conf
+ [[ -f '/etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' ]] && rm /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf
# cfg80211 last
for ((i=$(( ${#aWIFI_MODULES[@]} - 1 )); i>=0; i--))
do
+ echo "blacklist ${aWIFI_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_wifi.conf
modprobe -rf "${aWIFI_MODULES[$i]}" 2> /dev/null
- echo "blacklist ${aWIFI_MODULES[$i]}" >> /etc/modprobe.d/disable_wifi.conf
done
- # - Enable
- elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
+ if G_WHIP_YESNO 'Would you like to purge all WiFi related APT packages?
+ - (NOTICE) This will free up space, but an internet-capable Ethernet connection is required to re-enable WiFi functionality.'; then
+
+ G_AGP $packages
+ G_AGA
+
+ fi
- # - Install prereqs
- local pre_req_packages='crda iw rfkill wireless-tools wpasupplicant'
+ elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
- G_AG_CHECK_INSTALL_PREREQ $pre_req_packages || exit 1
+ # Disable known powersaving options for specific chipsets
+ cat << _EOF_ > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf
+options 8192cu rtw_power_mgnt=0
+options 8188eu rtw_power_mgnt=0
+# OPi Plus
+options 8189es rtw_power_mgnt=0
+# Pine A64
+options 8723bs rtw_power_mgnt=0
+# Sparky/Allo WiFi
+options wlan_8192eu rtw_power_mgnt=0
+_EOF_
- [[ -f '/etc/modprobe.d/disable_wifi.conf' ]] && rm /etc/modprobe.d/disable_wifi.conf
+ # Remove blacklists
+ [[ -f '/etc/modprobe.d/dietpi-disable_wifi.conf' ]] && rm /etc/modprobe.d/dietpi-disable_wifi.conf
- # - Disable known powersaving options for specific chipsets
- echo 'options 8192cu rtw_power_mgnt=0' > /etc/modprobe.d/8192cu.conf
- echo 'options 8188eu rtw_power_mgnt=0' > /etc/modprobe.d/8188eu.conf
- echo 'options 8189es rtw_power_mgnt=0' > /etc/modprobe.d/8189es.conf # OPi Plus
- echo 'options 8723bs rtw_power_mgnt=0' > /etc/modprobe.d/8723bs.conf # Pine A64
- echo 'options wlan_8192eu rtw_power_mgnt=0' > /etc/modprobe.d/wlan_8192eu.conf # Sparky/Allo WiFi
+ G_DIETPI-NOTIFY 2 'Please wait, enabling WiFi modules...'
# cfg80211 first
for i in "${aWIFI_MODULES[@]}"
@@ -1401,36 +1359,29 @@ Do you want to continue and disable the serial login console?'; then
done
- # - Delay. Without this, kernel reports WiFi device not found with RPi 3 and Pine A64 addon board, when ran straight after this script.
- G_DIETPI-NOTIFY 2 'Please wait, enabling WiFi Modules...'
- # - Had to up the delay from 3 seconds to 8 seconds on WPA2-Enterprise, otherwise still get device not found error.
+ # - Delay to allow modules + WPA2-Enterprise being fully loaded and avoid device not found error
sleep 8
+ # Install required APT packages
+ G_AG_CHECK_INSTALL_PREREQ $packages || EXIT_CODE=1
+
# + RPi 3+, unlock scan+wifi https://github.com/MichaIng/DietPi/issues/1627
rfkill unblock wifi &> /dev/null
- # Update our networking file (refresh active wlan index)
- /DietPi/dietpi/func/obtain_network_details
-
elif [[ $INPUT_DEVICE_VALUE == 'onboard_enable' ]]; then
(( $HW_ONBOARD_WIFI )) || { Unsupported_Input_Mode; return 1; }
- # NB: Requires reboot
- # NB: Do not change filenames, -f check used by DietPi-Config to obtain state
-
- [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]] && rm /etc/modprobe.d/disable_wifi_rpi3_onboard.conf
+ # Remove dtoverlay
+ sed -i '/^[[:blank:]]*dtoverlay=disable-wifi/d' $FP_RPI_CONFIG
elif [[ $INPUT_DEVICE_VALUE == 'onboard_disable' ]]; then
(( $HW_ONBOARD_WIFI )) || { Unsupported_Input_Mode; return 1; }
- # NB: Requires reboot
- # NB: Do not change filenames, -f check used by DietPi-Config to obtain state
-
- # - RPi 3/Zero W
- echo 'blacklist brcmfmac' > /etc/modprobe.d/disable_wifi_rpi3_onboard.conf
- echo 'blacklist brcmutil' >> /etc/modprobe.d/disable_wifi_rpi3_onboard.conf
+ # Disable via dtoverlay
+ G_CONFIG_INJECT 'dtoverlay=disable-wifi' 'dtoverlay=disable-wifi' $FP_RPI_CONFIG
+ dtoverlay disable-wifi
else
@@ -1438,6 +1389,9 @@ Do you want to continue and disable the serial login console?'; then
fi
+ # Update our networking file (refresh active wlan index)
+ /DietPi/dietpi/func/obtain_network_details
+
}
Wifi_Countrycode_Main(){
@@ -1470,13 +1424,8 @@ Do you want to continue and disable the serial login console?'; then
Serial_Main(){
#-------------------------------------------------------------------------------------
- #C1 on 3.x with Jessie, causes kernel hang.
- if (( $G_HW_MODEL == 10 )); then
-
- echo 'Not supported'
-
# Enable
- elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
+ if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then
# Enable for specific Serial/UART device
if [[ $INPUT_ADDITIONAL ]]; then
@@ -1513,11 +1462,10 @@ Do you want to continue and DISABLE Bluetooth now?'; then
grep -q "console=$INPUT_ADDITIONAL" /boot/cmdline.txt || sed -i "/root=/s/$/ console=$INPUT_ADDITIONAL,115200/" /boot/cmdline.txt
# - Odroid C2
- elif (( $G_HW_MODEL == 12 ||
- ( $G_HW_MODEL == 10 && $G_DISTRO == 3 ) )); then #REMOVE v6.24
+ elif (( $G_HW_MODEL == 12 )); then
local old=''
- [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv condev "' /DietPi/boot.ini) || return
+ [[ -f '/DietPi/boot.ini' ]] && old=$(grep -m1 '^setenv condev "' /DietPi/boot.ini) || return
[[ $old =~ console=$INPUT_ADDITIONAL ]] && return
old=$(cut -d \" -f 2 <<< "$old")
G_CONFIG_INJECT 'setenv condev "' "setenv condev \"$old console=$INPUT_ADDITIONAL,115200n8\"" /DietPi/boot.ini
@@ -1526,7 +1474,7 @@ Do you want to continue and DISABLE Bluetooth now?'; then
elif (( $G_HW_MODEL == 11 )); then
local old=''
- [[ -f /DietPi/boot.ini ]] && old=$(grep -m1 '^setenv bootrootfs "' /DietPi/boot.ini) || return
+ [[ -f '/DietPi/boot.ini' ]] && old=$(grep -m1 '^setenv bootrootfs "' /DietPi/boot.ini) || return
[[ $old =~ console=$INPUT_ADDITIONAL ]] && return
old=$(cut -d \" -f 2 <<< "$old")
G_CONFIG_INJECT 'setenv bootrootfs "' "setenv bootrootfs \"$old console=$INPUT_ADDITIONAL,115200n8\"" /DietPi/boot.ini
@@ -1585,9 +1533,11 @@ Do you want to continue and DISABLE Bluetooth now?'; then
if [[ $INPUT_ADDITIONAL ]]; then
G_DIETPI-NOTIFY 2 "Disabling serial-getty on: /dev/$INPUT_ADDITIONAL"
- systemctl stop serial-getty@$INPUT_ADDITIONAL
- systemctl disable serial-getty@$INPUT_ADDITIONAL
- # - Place a mask only if device exists
+ # Stop getty only if not currently attached, failsafe estimation in case of symlinks
+ local stop='--now'
+ [[ $(readlink -f $(tty)) == $(readlink -f /dev/$INPUT_ADDITIONAL) ]] && stop=''
+ systemctl disable $stop serial-getty@$INPUT_ADDITIONAL
+ # Place a mask only if device exists
[[ -e /dev/$INPUT_ADDITIONAL ]] && systemctl mask serial-getty@$INPUT_ADDITIONAL
# Disable boot messages depending on device
@@ -1638,6 +1588,16 @@ Do you want to continue and DISABLE Bluetooth now?'; then
done
+ # Cleanup: Disable for left non-existent devices
+ for i in /etc/systemd/system/getty.target.wants/serial-getty@*
+ do
+
+ [[ -e $i ]] || continue
+ i=${i%.service}
+ INPUT_ADDITIONAL=${i##*@} Serial_Main
+
+ done
+
# On RPi disable primary UART device
(( $G_HW_MODEL < 10 )) && G_CONFIG_INJECT 'enable_uart=' 'enable_uart=0' $FP_RPI_CONFIG
@@ -1665,18 +1625,19 @@ Do you want to continue and DISABLE Bluetooth now?'; then
# Disable all soundcards and revert back to default output if available.
Soundcard_Reset_All(){
+ # All
SOUNDCARD_TARGET_CARD=0
SOUNDCARD_TARGET_DEVICE=0
ALSA_EQ_ENABLED=0
- # Remove previous asound.conf
+ # - Remove previous asound.conf
[[ -f '/etc/asound.conf' ]] && rm /etc/asound.conf
- # - Pre-Reqs for any soundcard
- G_AG_CHECK_INSTALL_PREREQ alsa-utils
+ # - Remove previously stored alsactl state
+ [[ -f '/var/lib/alsa/state' ]] && rm /var/lib/alsa/state
- # Intel sound firmware
- grep -qi 'vendor_id.*intel' /proc/cpuinfo && G_AG_CHECK_INSTALL_PREREQ firmware-intel-sound
+ # - Reset active alsactl/amixer state
+ [[ $INPUT_DEVICE_VALUE != 'none' ]] && alsactl -g init
# HW specific
# - RPi
@@ -1716,16 +1677,11 @@ Do you want to continue and DISABLE Bluetooth now?'; then
fi
- systemctl daemon-reload
-
}
Soundcard_Reset_RPi(){
- # - Disable onboard sound
- G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=off' $FP_RPI_CONFIG
-
- # - Remove known soundcard dtoverlays
+ # Remove known soundcard dtoverlays
sed -i '/^[[:blank:]]*dtoverlay=hifiberry-/d' $FP_RPI_CONFIG
sed -i '/^[[:blank:]]*dtoverlay=iqaudio-/d' $FP_RPI_CONFIG
sed -i '/^[[:blank:]]*dtoverlay=justboom-/d' $FP_RPI_CONFIG
@@ -1736,22 +1692,11 @@ Do you want to continue and DISABLE Bluetooth now?'; then
sed -i '/^[[:blank:]]*dtoverlay=googlevoicehat-soundcard/d' $FP_RPI_CONFIG
sed -i '/^[[:blank:]]*dtoverlay=applepi-/d' $FP_RPI_CONFIG
- # - Remove I2C maps
- sed -i '/^[[:blank:]]*dtoverlay=i2s-mmap/d' $FP_RPI_CONFIG
+ # Disable I2S
sed -i '/^[[:blank:]]*dtparam=i2s=/d' $FP_RPI_CONFIG
- # - Disable forced analogue out
- if [[ -f '/etc/systemd/system/rpi-bcm2835_forced_3.5mm.service' ]]; then
-
- systemctl stop rpi-bcm2835_forced_3.5mm
- systemctl disable rpi-bcm2835_forced_3.5mm
- rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service
- systemctl daemon-reload
-
- fi
-
- # - Return Auto
- amixer -c 0 cset numid=3 0 &> /dev/null
+ # Disable onboard sound
+ G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=off' $FP_RPI_CONFIG
}
@@ -1759,21 +1704,19 @@ Do you want to continue and DISABLE Bluetooth now?'; then
[[ -f '/var/lib/dietpi/postboot.d/c2_smp.sh' ]] && rm /var/lib/dietpi/postboot.d/c2_smp.sh
- # - HiFi shield plus
+ # HiFi shield plus
sed -i '/^[[:blank:]]*snd-soc-pcm5102/d' /etc/modules
sed -i '/^[[:blank:]]*snd-soc-odroid-dac/d' /etc/modules
- # - HiFi shield 2
+ # HiFi shield 2
sed -i '/^[[:blank:]]*snd-soc-pcm512x/d' /etc/modules
sed -i '/^[[:blank:]]*snd-soc-pcm512x-i2c/d' /etc/modules
sed -i '/^[[:blank:]]*snd-soc-odroid-dac2/d' /etc/modules
if [[ -f '/etc/systemd/system/odroid-hifishield2.service' ]]; then
- systemctl stop odroid-hifishield2
- systemctl disable odroid-hifishield2
+ systemctl disable --now odroid-hifishield2
rm /etc/systemd/system/odroid-hifishield2.service
- systemctl daemon-reload
fi
@@ -1782,14 +1725,14 @@ Do you want to continue and DISABLE Bluetooth now?'; then
Soundcard_Reset_H2(){
# Set 3.5mm
- amixer set -c 0 'Audio lineout' unmute &> /dev/null
+ [[ $INPUT_DEVICE_VALUE == 'none' ]] || amixer set -c 0 'Audio lineout' unmute &> /dev/null
}
Soundcard_Reset_H3(){
# Set HDMI
- amixer set -c 0 'Audio lineout' mute &> /dev/null
+ [[ $INPUT_DEVICE_VALUE == 'none' ]] || amixer set -c 0 'Audio lineout' mute &> /dev/null
SOUNDCARD_TARGET_CARD=1
}
@@ -1803,43 +1746,48 @@ Do you want to continue and DISABLE Bluetooth now?'; then
Soundcard_Reset_SparkySBC(){
+ # Allo Piano DAC
sed -i '/^[[:blank:]]*snd-soc-allo-piano-dac/d' /etc/modules
- # Set HDMI
- SOUNDCARD_TARGET_DEVICE=1
- amixer -c 0 sset 'audio output mode switch' 'hdmi'
-
# Disable USB 1.1 compat
sed -i 's/aotg.aotg1_speed=1/aotg.aotg1_speed=0/' $FP_UENV
- # Auto unmute
- [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]] && rm /var/lib/dietpi/postboot.d/sparky_unmute.sh
+ # Set HDMI
+ SOUNDCARD_TARGET_DEVICE=1
+ [[ $INPUT_DEVICE_VALUE != 'none' ]] && amixer -c 0 sset 'audio output mode switch' 'hdmi'
}
Soundcard_Reset_BPi_Pro(){
# Set 3.5mm: https://github.com/MichaIng/DietPi/issues/732#issuecomment-275915919
- SOUNDCARD_TARGET_CARD=0
+ if [[ $INPUT_DEVICE_VALUE != 'none' ]]; then
- amixer sset 'Left Mixer Left DAC' off
- amixer sset 'Power Amplifier' 62
- amixer sset 'Power Amplifier DAC' on
- amixer sset 'Power Amplifier Mixer' off
- amixer sset 'Power Amplifier Mute' on
- amixer sset 'Right Mixer Left DAC' off
- amixer sset 'Right Mixer Right DAC' off
+ amixer sset 'Left Mixer Left DAC' off
+ amixer sset 'Power Amplifier' 62
+ amixer sset 'Power Amplifier DAC' on
+ amixer sset 'Power Amplifier Mixer' off
+ amixer sset 'Power Amplifier Mute' on
+ amixer sset 'Right Mixer Left DAC' off
+ amixer sset 'Right Mixer Right DAC' off
+
+ fi
}
Soundcard_Main(){
#-----------------------------------------------------------------------------
- # Always reset soundcards and revert back to HDMI
+ # Failsafe: Assure installed alsa-utils, if soundcard has been selected
+ [[ $INPUT_DEVICE_VALUE == 'none' ]] || G_AG_CHECK_INSTALL_PREREQ alsa-utils
+ # Always reset soundcards and revert back to defaults
Soundcard_Reset_All
+ # Save selection to dietpi.txt
+ G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' "CONFIG_SOUNDCARD=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt
+ # Return now if no soundcard has been selected
+ [[ $INPUT_DEVICE_VALUE == 'none' ]] && return
#-----------------------------------------------------------------------------
- # Apply specific asound.confs and additional settings
-
+ # Apply specific asound.conf and additional settings
# - ALSA EQ enabled?
if [[ $INPUT_DEVICE_VALUE == *'-eq' ]]; then
@@ -1850,54 +1798,45 @@ Do you want to continue and DISABLE Bluetooth now?'; then
fi
- # - Update DietPi global soundcard var
- G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' "CONFIG_SOUNDCARD=$INPUT_DEVICE_VALUE" /DietPi/dietpi.txt
+ # - RPi: Quick workaround for vc4 taking card 0: https://github.com/MichaIng/DietPi/issues/2173
+ (( $G_HW_MODEL < 10 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-' $FP_RPI_CONFIG && ((SOUNDCARD_TARGET_CARD++))
- # Cards
+ # - Cards
case "$INPUT_DEVICE_VALUE" in
- # ALL: ----------------------------------------------------------------------
-
- # Specify card + device indexs
+ # --------------- Generic ---------------
+ # - Specific card + device, e.g. from auto-detection
hw:*)
- echo "$INPUT_DEVICE_VALUE"
- local split=$(sed 's/,/ /g' <<< "$INPUT_DEVICE_VALUE" | sed -E 's/(hw:|-eq)//g')
- SOUNDCARD_TARGET_CARD=$(mawk '{print $1}' <<< "$split")
- SOUNDCARD_TARGET_DEVICE=$(mawk '{print $2}' <<< "$split")
+ SOUNDCARD_TARGET_CARD=$(mawk -F, '{print $1}' <<< ${INPUT_DEVICE_VALUE#hw:})
+ SOUNDCARD_TARGET_DEVICE=$(mawk -F, '{print $2}' <<< ${INPUT_DEVICE_VALUE#hw:})
;;
+ # - Auto detect USB DAC
usb-dac*)
- # - detect card
local usb_detection_card_index=$(aplay -l | mawk '/USB Audio/ {print $2;exit}' | sed 's/://g')
if disable_error=1 G_CHECK_VALIDINT "$usb_detection_card_index"; then
SOUNDCARD_TARGET_CARD=$usb_detection_card_index
+ SOUNDCARD_TARGET_DEVICE=0
- # - Sparky unmute all (re: @sudeep)
+ # Sparky SBC
if (( $G_HW_MODEL == 70 )); then
- # USB 1.1 compat mode (Sparky currently)
- if [[ $INPUT_DEVICE_VALUE == 'usb-dac-1.1' ]]; then
-
- sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' $FP_UENV
+ # - USB 1.1 compat mode (Sparky currently)
+ [[ $INPUT_DEVICE_VALUE == *'1.1' ]] && sed -i 's/aotg.aotg1_speed=0/aotg.aotg1_speed=1/' $FP_UENV
- fi
+ # - Unmute all (re: @sudeep)
+ for x in $(amixer -c $SOUNDCARD_TARGET_CARD controls | grep layback)
+ do
- cat << _EOF_ > /var/lib/dietpi/postboot.d/sparky_unmute.sh
-#!/bin/bash
-for x in \$(amixer controls | grep layback)
-do
+ amixer -c $SOUNDCARD_TARGET_CARD cset "$x" 100%
- amixer cset "\$x" 100% &> /dev/null
+ done
-done
-alsactl store &> /dev/null
-_EOF_
-
- # https://github.com/MichaIng/DietPi/issues/2101
+ # Odroid C2: https://github.com/MichaIng/DietPi/issues/2101
elif (( $G_HW_MODEL == 12 )); then
cat << _EOF_ > /var/lib/dietpi/postboot.d/c2_smp.sh
@@ -1905,115 +1844,31 @@ _EOF_
echo 4 > /proc/irq/63/smp_affinity
echo 8 > /proc/irq/62/smp_affinity
_EOF_
+ . /var/lib/dietpi/postboot.d/c2_smp.sh
fi
# - Not found
else
- G_DIETPI-NOTIFY 1 'Unable to find a USB-DAC on system.'
+ G_DIETPI-NOTIFY 1 'Unable to find a USB DAC on your system, reverting to "none"...'
EXIT_CODE=1
-
- # - Reset
G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' 'CONFIG_SOUNDCARD=none' /DietPi/dietpi.txt
+ return
fi
- SOUNDCARD_TARGET_DEVICE=0
-
;;
- # RPi
- # rpi-bcm2835
- # rpi-bcm2835-ultrahq
- # rpi-bcm2835-3.5mm
- # rpi-bcm2835-ultrahq-3.5mm
- rpi-bcm2835*)
+ # Intel SST DSP
+ intel-sst-dsp)
- # - Enable onboard audio dtparm
- G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' $FP_RPI_CONFIG
-
- # - Force 3.5mm out?
- if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]]; then
-
- cat << _EOF_ > /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service
-[Unit]
-Description=Forces sound through 3.5mm analogue
-Before=sound.target
-After=dietpi-boot.service
-
-[Service]
-RemainAfterExit=yes
-ExecStart=/usr/bin/amixer -c 0 cset numid=3 1
-
-[Install]
-WantedBy=multi-user.target
-_EOF_
- systemctl daemon-reload
- systemctl enable rpi-bcm2835_forced_3.5mm
- systemctl start rpi-bcm2835_forced_3.5mm
-
- fi
-
- ;;
-
- # RPi (dtoverlay)
- # hifiberry-dac
- # hifiberry-dacplus
- # hifiberry-digi
- # hifiberry-digi-pro
- # hifiberry-amp
- hifiberry-*)
-
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ G_AG_CHECK_INSTALL_PREREQ 'firmware-intel-sound'
;;
- # RPi (dtoverlay)
- # googlevoicehat-soundcard
- googlevoicehat-soundcard*)
-
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
- G_CONFIG_INJECT 'dtoverlay=i2s-mmap' 'dtoverlay=i2s-mmap' $FP_RPI_CONFIG
- G_CONFIG_INJECT 'dtparam=i2s=' 'dtoverlay=i2s=on' $FP_RPI_CONFIG
-
- ;;
-
- # RPi (dtoverlay)
- # JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero
- # JustBoom-digi: Digi HAT and Digi Zero
- justboom-*)
-
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
-
- ;;
-
- # RPi (dtoverlay)
- # allo-piano-dac-pcm512x-audio
- # allo-piano-dac-plus-pcm512x-audio (2.1)
- allo-piano-dac*)
-
- if [[ ! -d '/lib/firmware/allo' ]]; then
-
- INSTALL_URL_ADDRESS='https://github.com/allocom/piano-firmware/archive/master.zip'
- G_CHECK_URL "$INSTALL_URL_ADDRESS"
- wget "$INSTALL_URL_ADDRESS" -O package.zip
- unzip -o package.zip
- rm package.zip
- mkdir -p /lib/firmware
- mv piano-firmware-master/lib/firmware/allo /lib/firmware/
- rm -R piano-firmware-master
-
- fi
-
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
-
- ;;
-
- # Sparky SBC (module)
+ # --------------- Sparky SBC ------------
+ # Allo Piano DAC (firmware + module)
# snd-soc-allo-piano-dac
# snd-soc-allo-piano-dac-plus (2.1)
snd-soc-allo-piano-dac*)
@@ -2029,13 +1884,14 @@ _EOF_
fi
G_CONFIG_INJECT "$INPUT_DEVICE_VALUE" "$INPUT_DEVICE_VALUE" /etc/modules
+ modprobe $INPUT_DEVICE_VALUE
SOUNDCARD_TARGET_CARD=1
SOUNDCARD_TARGET_DEVICE=0
amixer -c 0 sset 'audio output mode switch' 'i2s'
;;
- # Sparky SBC
+ # Allo Cheapo
# allo-cheapo-analogue # 3.5mm/RCA
# allo-cheapo-optical # Optical out
allo-cheapo*)
@@ -2059,64 +1915,100 @@ _EOF_
;;
- # RPi (dtoverlay)
- # allo-boss-dac-pcm512x-audio
- # allo-digione
- # allo-katana-dac-audio
- allo-*)
+ # --------------- RPi -------------------
+ # Onboard
+ # rpi-bcm2835-auto
+ # rpi-bcm2835-hdmi
+ # rpi-bcm2835-3.5mm
+ rpi-bcm2835*)
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ # - Enable onboard audio dtparm
+ G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' $FP_RPI_CONFIG
+ dtparam audio=on
+ sleep 1 # Allow hardware to init
- ;;
+ # - Force 3.5mm out?
+ if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]]; then
- # RPi (dtoverlay)
- # rpi-dac
- rpi-dac)
+ amixer -c $SOUNDCARD_TARGET_CARD cset numid=3 1
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]]; then
- ;;
+ amixer -c $SOUNDCARD_TARGET_CARD cset numid=3 2
- # AudioPhonics I-Sabre-Q2M/K2M (dtoverlay)
- # i-sabre-q2m
- i-sabre-q2m)
+ else
- # - enable dtoverlay
- G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ amixer -c $SOUNDCARD_TARGET_CARD cset numid=3 0
+
+ fi
;;
- # RPi (dtoverlay)
- # applepi-dac
- applepi*)
+ # Allo Piano DAC (firmware + dtoverlay)
+ # allo-piano-dac-pcm512x-audio
+ # allo-piano-dac-plus-pcm512x-audio (2.1)
+ allo-piano-dac*)
+
+ if [[ ! -d '/lib/firmware/allo' ]]; then
+
+ INSTALL_URL_ADDRESS='https://github.com/allocom/piano-firmware/archive/master.zip'
+ G_CHECK_URL "$INSTALL_URL_ADDRESS"
+ wget "$INSTALL_URL_ADDRESS" -O package.zip
+ unzip -o package.zip
+ rm package.zip
+ mkdir -p /lib/firmware
+ mv piano-firmware-master/lib/firmware/allo /lib/firmware/
+ rm -R piano-firmware-master
+
+ fi
- # - enable dtoverlay
G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ dtoverlay $INPUT_DEVICE_VALUE
;;
- iqaudio-*)
+ # dtoverlay
+ # hifiberry-dac
+ # hifiberry-dacplus
+ # hifiberry-digi
+ # hifiberry-digi-pro
+ # hifiberry-amp
+ # JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero
+ # JustBoom-digi: Digi HAT and Digi Zero
+ # allo-boss-dac-pcm512x-audio
+ # allo-digione
+ # allo-katana-dac-audio
+ # rpi-dac
+ # i-sabre-q2m
+ # applepi-dac
+ # iqaudio-*
+ # dionaudio-loco(-v2)
+ hifiberry-*|justboom-*|allo-*|rpi-dac|i-sabre-q2m|applepi*|iqaudio-*|dionaudio-loco*)
- # - enable dtoverlay
+ # Enable dtoverlay
G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ dtoverlay $INPUT_DEVICE_VALUE
;;
- # dionaudio-loco(-v2)
- dionaudio-loco*)
+ # dtoverlay + I2S
+ # googlevoicehat-soundcard
+ googlevoicehat-soundcard*)
- # - enable dtoverlay
+ # Enable dtoverlay + I2S
+ G_CONFIG_INJECT 'dtparam=i2s=' 'dtparam=i2s=on' $FP_RPI_CONFIG
+ dtparam i2s=on
G_CONFIG_INJECT "dtoverlay=$INPUT_DEVICE_VALUE" "dtoverlay=$INPUT_DEVICE_VALUE" $FP_RPI_CONFIG
+ dtoverlay $INPUT_DEVICE_VALUE
;;
- # Odroid -------------------------------------------------------------------------------
+ # --------------- Odroid ----------------
odroid-hifishield-plus)
G_CONFIG_INJECT 'snd-soc-pcm5102' 'snd-soc-pcm5102' /etc/modules
G_CONFIG_INJECT 'snd-soc-odroid-dac' 'snd-soc-odroid-dac' /etc/modules
+ modprobe snd-soc-pcm5102 snd-soc-odroid-dac
SOUNDCARD_TARGET_CARD=1
@@ -2128,6 +2020,7 @@ _EOF_
G_CONFIG_INJECT 'snd-soc-pcm512x' 'snd-soc-pcm512x' /etc/modules
G_CONFIG_INJECT 'snd-soc-pcm512x-i2c' 'snd-soc-pcm512x-i2c' /etc/modules
G_CONFIG_INJECT 'snd-soc-odroid-dac2' 'snd-soc-odroid-dac2' /etc/modules
+ modprobe aml_i2c snd-soc-pcm512x snd-soc-pcm512x-i2c snd-soc-odroid-dac2
SOUNDCARD_TARGET_CARD=1
@@ -2148,46 +2041,34 @@ ExecStart=$(command -v amixer) -c 1 sset Deemphasis on
WantedBy=sound.target
_EOF_
systemctl daemon-reload
- systemctl enable odroid-hifishield2
+ systemctl enable --now odroid-hifishield2
;;
- # H2 -------------------------------------------------------------------------------
+ # --------------- H2 --------------------
h2-hdmi)
- amixer set -c 0 'Audio lineout' mute &> /dev/null
+ amixer set -c 0 'Audio lineout' mute
SOUNDCARD_TARGET_CARD=1
;;
- # H3 -------------------------------------------------------------------------------
+ # --------------- H3 --------------------
h3-analogue)
- amixer set -c 0 'Audio lineout' unmute &> /dev/null
- SOUNDCARD_TARGET_CARD=0
-
- ;;
-
- # Pine A64 -------------------------------------------------------------------------------
- pine64-analogue)
-
- cat << _EOF_ > /etc/modules-load.d/pine64-audiojack.conf
-sunxi_codec
-sunxi_i2s
-sunxi_sndcodec
-_EOF_
+ amixer set -c 0 'Audio lineout' unmute
SOUNDCARD_TARGET_CARD=0
;;
- # NanoPi M2/M3 -------------------------------------------------------------------------------
+ # --------------- NanoPi M2/M3 ----------
s5pxx18-hdmi)
SOUNDCARD_TARGET_CARD=1
;;
- # Asus tinker -------------------------------------------------------------------------------
+ # --------------- ASUS TB ---------------
asus-tb-analogue)
SOUNDCARD_TARGET_CARD=0
@@ -2197,9 +2078,6 @@ _EOF_
esac
- # - Quick RPi workaround for vc4 taking card 0: https://github.com/MichaIng/DietPi/issues/2173
- (( $G_HW_MODEL < 10 )) && grep -q '^[[:blank:]]*dtoverlay=vc4-' $FP_RPI_CONFIG && ((SOUNDCARD_TARGET_CARD++))
-
# - Apply asound.conf
if [[ $INPUT_DEVICE_VALUE == 'googlevoicehat-soundcard'* ]]; then
@@ -2236,6 +2114,8 @@ _EOF_
elif (( $ALSA_EQ_ENABLED )); then
+ G_AG_CHECK_INSTALL_PREREQ libasound2-plugin-equal
+
cat << _EOF_ > /etc/asound.conf
ctl.eq {
type equal
@@ -2260,8 +2140,6 @@ ctl.!default {
}
_EOF_
- G_AG_CHECK_INSTALL_PREREQ libasound2-plugin-equal
-
else
cat << _EOF_ > /etc/asound.conf
@@ -2279,13 +2157,16 @@ _EOF_
fi
+ # Store control states once and force restore service, to assure it is active (states preserved) for next reboot
+ alsactl store
+ systemctl restart alsa-restore
+
}
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
#-----------------------------------------------------------------------------------
- # info
G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_DEVICE_NAME ($INPUT_DEVICE_VALUE)"
#-----------------------------------------------------------------------------------
diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software
index 59701e63ad..3d71e9a9f7 100644
--- a/dietpi/func/dietpi-set_software
+++ b/dietpi/func/dietpi-set_software
@@ -22,7 +22,6 @@ $FP_SCRIPT apt-cache clean|reset|cache|lists|archives [disable|ram|disk]
$FP_SCRIPT ntpd-mode [0-4] Time sync modes: 0=custom|1=boot|2=boot+daily|3=boot+hourly|4=daemon+drift
$FP_SCRIPT verify_dietpi.txt Verifies dietpi.txt entries, adds missing entries if required
$FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=optional set X as global password for future dietpi-software installations and \"root\" + \"dietpi\" login passwords.
-$FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi specific content, and, DietPi userdata directory for software installs
" #////////////////////////////////////
# Grab inputs
@@ -103,38 +102,24 @@ $FP_SCRIPT setpermissions Applies required filesystem permissions to DietPi spe
if [[ $INPUT_MODE_VALUE ]]; then
- # Jessie ARMv8: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864
- if (( $G_HW_ARCH == 3 && $G_DISTRO < 4 )); then
-
- INPUT_MODE_VALUE='http://archive.debian.org/debian/'
-
- # Set defaults?
- elif [[ $INPUT_MODE_VALUE == 'default' ]]; then
-
- if (( $G_HW_MODEL < 10 )); then
-
- INPUT_MODE_VALUE='http://raspbian.raspberrypi.org/raspbian/'
-
- else
-
- INPUT_MODE_VALUE='https://deb.debian.org/debian/'
-
- fi
-
- fi
-
- # Set Raspbian
+ # Raspbian
if (( $G_HW_MODEL < 10 )); then
+ # - Default?
+ [[ $INPUT_MODE_VALUE == 'default' ]] && INPUT_MODE_VALUE='http://raspbian.raspberrypi.org/raspbian/'
+
echo "deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free rpi" > /etc/apt/sources.list
echo "deb https://archive.raspberrypi.org/debian/ $G_DISTRO_NAME main ui" > /etc/apt/sources.list.d/raspi.list
# - Update dietpi.txt entry
G_CONFIG_INJECT 'CONFIG_APT_RASPBIAN_MIRROR=' "CONFIG_APT_RASPBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt
- # Set Debian
+ # Debian
else
+ # - Default?
+ [[ $INPUT_MODE_VALUE == 'default' ]] && INPUT_MODE_VALUE='https://deb.debian.org/debian/'
+
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
@@ -142,17 +127,8 @@ deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib
deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free
_EOF_
- # - Jessie: https://github.com/MichaIng/DietPi/issues/2665#issuecomment-477348864
- if (( $G_DISTRO < 4 )); then
-
- # - Jessie APT reports warning on httpS://deb.debian.org
- sed -i 's|https://deb.debian.org|http://deb.debian.org|g' /etc/apt/sources.list
- # - backports and updates have been dropped
- sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list
- # - ARMv8 has been dropped from security repo
- (( $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list
-
- fi
+ # - On Bullseye, dir structure has changed: https://deb.debian.org/debian-security/dists/
+ (( $G_DISTRO > 5 )) && sed -i '3s|/updates|-security|' /etc/apt/sources.list
# - Update dietpi.txt entry
G_CONFIG_INJECT 'CONFIG_APT_DEBIAN_MIRROR=' "CONFIG_APT_DEBIAN_MIRROR=$INPUT_MODE_VALUE" /DietPi/dietpi.txt
@@ -270,50 +246,46 @@ _EOF_
#/////////////////////////////////////////////////////////////////////////////////////
# Set NTPD Mode
- # NB: also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR
+ # NB: Also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR
#/////////////////////////////////////////////////////////////////////////////////////
NtpdMode_Main(){
if G_CHECK_VALIDINT "$INPUT_MODE_VALUE" 0 4; then
- # - Reset global to disabled, prevents run_ntpd in dietpi-software
+ # Reset global to disabled, prevents run_ntpd in dietpi-software
sed -i '/CONFIG_NTP_MODE=/c\CONFIG_NTP_MODE=0' /DietPi/dietpi.txt
- # - Kill current
- killall -w /DietPi/dietpi/func/run_ntpd &> /dev/null
-
- local ntp_mirror=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MIRROR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local ntp_mirror=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MIRROR=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
[[ $ntp_mirror ]] || ntp_mirror='default'
- local ntp_mirror_entry="Servers=$ntp_mirror"
-
- # - Default, lets timesyncd use DHCP server (Stretch+ only) or fallback to debian.pool.ntp.org.
- if [[ ${ntp_mirror,,} == 'default' ]]; then
- ntp_mirror_entry='#Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org'
+ # Gateway, auto detect local gateway(s) (router) to use as NTP server.
+ if [[ ${ntp_mirror,,} == 'gateway' ]]; then
- # - Gateway, auto detect local gateway(s) (router) to use as NTP server.
- elif [[ ${ntp_mirror,,} == 'gateway' ]]; then
-
- # NB: Turn output output into single line string via echo
- local gateway=$(echo $(ip r | mawk '/^default/ {print $3}'))
+ # NB: Convert output to single line via echo
+ local gateway=$(echo $(ip r s 0.0.0.0/0 | mawk '{print $3}'))
if [[ $gateway ]]; then
G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)."
- ntp_mirror_entry="Servers=$gateway"
+ ntp_mirror=$gateway
else
- G_DIETPI-NOTIFY 1 'No local gateway detected. No NTP mirror change will be applied.'
+ G_DIETPI-NOTIFY 1 'No local gateway detected. Reverting NTP mirror back to system defaults.'
EXIT_CODE=1
- return 1
+ ntp_mirror='default'
fi
- # - Add pool.ntp.org entries with subdomains "[0-3].", other entries without.
- elif [[ $ntp_mirror =~ 'pool.ntp.org' ]]; then
+ fi
- ntp_mirror_entry='Servers='
- local i
+ # Default, lets timesyncd use DHCP server or fallback to debian.pool.ntp.org.
+ if [[ ${ntp_mirror,,} == 'default' ]]; then
+
+ [[ -f '/etc/systemd/timesyncd.conf' ]] && rm /etc/systemd/timesyncd.conf
+
+ else
+
+ local i ntp_mirror_entry
for i in $ntp_mirror
do
@@ -329,31 +301,26 @@ _EOF_
done
- fi
+ # Set mirror
+ echo -e "[Time]\nServers=${ntp_mirror_entry% }" > /etc/systemd/timesyncd.conf
- # - Set mirror
- cat << _EOF_ > /etc/systemd/timesyncd.conf
-[Time]
-$ntp_mirror_entry
-_EOF_
+ fi
- # - Daemon mode, dbus required for timedatectl, that users may expect
+ # Daemon mode, dbus required for timedatectl, that users may expect
if (( $INPUT_MODE_VALUE == 4 )); then
G_AG_CHECK_INSTALL_PREREQ dbus
systemctl unmask systemd-timesyncd # Failsafe
- systemctl enable systemd-timesyncd
- systemctl start systemd-timesyncd
+ systemctl enable --now systemd-timesyncd
- # - Else, disable systemd-timesyncd to let "run_ntpd" or other time sync system take control
+ # Else, disable systemd-timesyncd to let "run_ntpd" or other time sync system take control
else
- systemctl stop systemd-timesyncd
- systemctl disable systemd-timesyncd
+ systemctl disable --now systemd-timesyncd
fi
- # - Update DietPi.txt
+ # Update DietPi.txt
G_CONFIG_INJECT 'CONFIG_NTP_MODE=' "CONFIG_NTP_MODE=$INPUT_MODE_VALUE" /DietPi/dietpi.txt
else
@@ -390,181 +357,6 @@ _EOF_
}
- #/////////////////////////////////////////////////////////////////////////////////////
- # Setpermissions_Main
- #/////////////////////////////////////////////////////////////////////////////////////
- Setpermissions_Main(){
-
- # Failsafe, assure /var/tmp 777 permissions: https://github.com/MichaIng/DietPi/issues/1144#issuecomment-425758727
- chmod 777 /var/tmp
-
- # DietPi-Software secure global_pw encrypted
- chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
- chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
-
- # Webserver
- chown -R www-data:www-data /var/www
- chmod -R 775 /var/www
-
- # Apply non-root permissions for files and folders in G_FP_DIETPI_USERDATA
- # - dietpi user
- # Include symlinked locations via $G_FP_DIETPI_USERDATA/*
- chown -R dietpi:dietpi /home/dietpi $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/*
- chmod -R 775 $G_FP_DIETPI_USERDATA $G_FP_DIETPI_USERDATA/*
-
- # Apply program specific permissions
- # - NB: Following should be ordered ascending by index to prevent dupes.
- # - Desktops
- chown -R 775 /var/lib/dietpi/dietpi-software/installed/desktop
- # Set execute to prevent "untrusted" prompt in Mate, and possibily other desktops.
- chmod +x /usr/share/applications/*
- chmod +x /root/Desktop/*
-
- # - O!MPD, requires write permissions for database, streaming and downloading
- chmod -R 777 /var/www/ompd/{tmp,stream,cache}
-
- # - MPD
- chmod 0664 /var/log/mpd/mpd.log /etc/mpd.conf
- chmod -R 775 /var/lib/mpd $G_FP_DIETPI_USERDATA/.mpd_cache
- chown -R mpd:dietpi /etc/mpd.conf /var/log/mpd $G_FP_DIETPI_USERDATA/.mpd_cache /var/lib/mpd
-
- # - myMPD
- chown -R mympd:dietpi /var/lib/mympd
-
- # - Mopidy
- chown -R mopidy:root $G_FP_DIETPI_USERDATA/mopidy
-
- # - Minidlna
- chown -R minidlna:dietpi $G_FP_DIETPI_USERDATA/.MiniDLNA_Cache
-
- # - AirSonic
- chown -R airsonic:dietpi $G_FP_DIETPI_USERDATA/airsonic
-
- # - MySQL data store
- chown -R mysql:mysql $G_FP_DIETPI_USERDATA/mysql
- chmod -R 770 $G_FP_DIETPI_USERDATA/mysql
-
- # - UrBackup
- chown -R urbackup:urbackup $G_FP_DIETPI_USERDATA/urbackup
-
- # - www-data
- chown -R www-data:www-data $G_FP_DIETPI_USERDATA/rpicam
- chown -R www-data:www-data $G_FP_DIETPI_USERDATA/pydio_data
-
- local datadir=$(grep -m1 '^[[:blank:]]*SOFTWARE_OWNCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- [[ $datadir ]] || datadir="$G_FP_DIETPI_USERDATA/owncloud_data"
- chown -R www-data:www-data "$datadir"
-
- datadir=$(grep -m1 '^[[:blank:]]*SOFTWARE_NEXTCLOUD_DATADIR=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- [[ $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 $G_FP_DIETPI_USERDATA/homeassistant
-
- # - Minio
- chown -R minio-user:minio-user $G_FP_DIETPI_USERDATA/minio-data
-
- # - FuguHub
- chown -R bd:bd $G_FP_DIETPI_USERDATA/fuguhub-data/
-
- # - Nodered
- chown -R nodered:nodered $G_FP_DIETPI_USERDATA/node-red
-
- # - grafana
- chown -R grafana:grafana $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana
-
- # - influxDB
- chown -R influxdb:influxdb $G_FP_DIETPI_USERDATA/influxdb
-
- # - gogs
- chown -R gogs:gogs /etc/gogs $G_FP_DIETPI_USERDATA/gogs-repo /var/log/gogs
-
- # - ubooquity
- chown -R ubooquity:dietpi $G_FP_DIETPI_USERDATA/ubooquity
-
- # - Mineos
- chown -R mineos:dietpi $G_FP_DIETPI_USERDATA/mineos /var/games/minecraft /etc/ssl/certs/mineos*
-
- # - cubrite
- chown -R cuberite:dietpi $G_FP_DIETPI_USERDATA/cubrite
-
- # - sickrage # pre-v6.20 compatibility
- [[ -d $G_FP_DIETPI_USERDATA/sickrage ]] && chown -R sickrage:dietpi $G_FP_DIETPI_USERDATA/sickrage
- [[ -f '/var/log/sickrage.log' ]] && chown sickrage:dietpi /var/log/sickrage.log
-
- # - Medusa
- chown -R medusa:dietpi $G_FP_DIETPI_USERDATA/medusa
-
- # - Sonarr
- chown -R sonarr:dietpi $G_FP_DIETPI_USERDATA/sonarr /opt/NzbDrone /var/log/sonarr
-
- # - Radarr
- chown -R radarr:dietpi $G_FP_DIETPI_USERDATA/radarr /opt/Radarr /var/log/radarr
-
- # - Lidarr
- chown -R lidarr:dietpi $G_FP_DIETPI_USERDATA/lidarr /opt/Lidarr /var/log/lidarr
-
- # - Tonido
- chown -R tonido:dietpi $G_FP_DIETPI_USERDATA/tonido /home/tonido
-
- # - NZBget
- chown -R nzbget:dietpi $G_FP_DIETPI_USERDATA/nzbget
-
- # - Roon Bridge
- chown -R roon:dietpi $G_FP_DIETPI_USERDATA/roon $G_FP_DIETPI_USERDATA/roonserver /var/log/roon
-
- # - GMrender
- chown gmrender:dietpi /var/log/gmrender.log
-
- # - PlexPy
- chown -R plexpy:plexpy /opt/plexpy
- chown -R plexpy:dietpi $G_FP_DIETPI_USERDATA/plexpy
-
- # - Deluge
- chown -R debian-deluged:debian-deluged $G_FP_DIETPI_USERDATA/deluge
- chown -R debian-deluged /var/log/deluged
-
- # - Jackett
- chown -R jackett:jackett /opt/jackett
-
- # - Koel
- chown -R koel:dietpi $G_FP_DIETPI_USERDATA/koel
-
- # - qBitTorrent
- chown -R qbittorrent:dietpi /home/qbittorrent
-
- # - rTorrent
- chown -R rtorrent:rtorrent $G_FP_DIETPI_USERDATA/rtorrent $G_FP_DIETPI_USERDATA/downloads/.session
- # ruTorrent web access
- chown www-data:www-data /etc/.rutorrent-htaccess
- chmod 400 /etc/.rutorrent-htaccess
-
- # - FAHClient (Folding@Home)
- chown -R fahclient:dietpi $G_FP_DIETPI_USERDATA/fahclient /var/log/fahclient.log
-
- # - Sabnzbd
- chown -R sabnzbd:sabnzbd /etc/sabnzbd /var/log/sabnzbd $G_FP_DIETPI_USERDATA/downloads/sabnzbd*
- chown -R sabnzbd:dietpi $G_FP_DIETPI_USERDATA/downloads/{,in}complete
-
- # - Blynk
- chown -R blynk:dietpi $G_FP_DIETPI_USERDATA/blynk /var/log/blynk
-
- # - Mycroft AI
- chown -R mycroft:mycroft $G_FP_DIETPI_USERDATA/mycroft-core /etc/mycroft $G_FP_DIETPI_USERDATA/mycroft-data /var/log/mycroft
-
- # - Pi-hole
- # - NB: Git requies special permissions to allow "pihole -up".
- if [[ -d '/var/www/html/pihole' ]]; then
-
- cd /var/www/html/admin && git reset --hard HEAD
- cd /tmp/$G_PROGRAM_NAME
-
- fi
-
- }
-
#/////////////////////////////////////////////////////////////////////////////////////
# Users
#/////////////////////////////////////////////////////////////////////////////////////
@@ -585,7 +377,7 @@ _EOF_
# - DietPi-PREP, 1st run setup or user cancelled manual password choice
else
- GLOBAL_PW=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
fi
[[ $GLOBAL_PW ]] || GLOBAL_PW='dietpi'
@@ -722,7 +514,8 @@ It is highly recommended to change this password, ideally, it should be differen
(( $G_DISTRO > 4 )) && pbkdf2='-iter 10000'
openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $pw_dietpi_software
- Setpermissions_Main &> /dev/null
+ chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
+ chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
G_DIETPI-NOTIFY 2 'Global software password successfully changed'
@@ -782,10 +575,6 @@ It is highly recommended to change this password, ideally, it should be differen
Passwords_Main
- elif [[ $INPUT_MODE_NAME == 'setpermissions' ]]; then
-
- Setpermissions_Main &> /dev/null # As no file existence checks are done, hide output
-
else
Unknown_Input_Name
diff --git a/dietpi/func/dietpi-set_userdata b/dietpi/func/dietpi-set_userdata
index 5467269b97..bb3a58fdc4 100644
--- a/dietpi/func/dietpi-set_userdata
+++ b/dietpi/func/dietpi-set_userdata
@@ -36,26 +36,26 @@
Run_Move_Data(){
- # - Stop all running services
+ # Stop all running services
/DietPi/dietpi/dietpi-services stop
- # - Copy source to target, if it contains any files/folders
+ # Copy source to target, if it contains any files/folders
if [[ -z $(find $SOURCE_DIRECTORY -maxdepth 0 -empty) ]]; then
G_DIETPI-NOTIFY 0 "Moving your existing data from $SOURCE_DIRECTORY to $TARGET_DIRECTORY"
G_DIETPI-NOTIFY 2 'Please wait...\n'
- # - Begin transfer
+ # Begin transfer
if cp -a "$SOURCE_DIRECTORY"/. "$TARGET_DIRECTORY"/; then
- # - Remove source
+ # Remove source
rm -R "$SOURCE_DIRECTORY"
- # - Create symlink to G_FP_DIETPI_USERDATA if required
+ # Create symlink to G_FP_DIETPI_USERDATA if required
if [[ $TARGET_DIRECTORY != $G_FP_DIETPI_USERDATA ]]; then
- rm -R $G_FP_DIETPI_USERDATA &> /dev/null
- ln -sf "$TARGET_DIRECTORY" $G_FP_DIETPI_USERDATA
+ rm -Rf $G_FP_DIETPI_USERDATA
+ ln -s "$TARGET_DIRECTORY" $G_FP_DIETPI_USERDATA
fi
@@ -63,17 +63,14 @@
else
- LOGFILE_OUTPUT_TEXT="ERROR: Failed to copy $SOURCE_DIRECTORY/* to $TARGET_DIRECTORY."
+ LOGFILE_OUTPUT_TEXT="ERROR: Failed to copy $SOURCE_DIRECTORY/ to $TARGET_DIRECTORY."
EXIT_CODE=1
fi
fi
- # - Set permissions
- /DietPi/dietpi/func/dietpi-set_software setpermissions
-
- # - Start services back up again
+ # Start services back up again
/DietPi/dietpi/dietpi-services start
}
@@ -120,7 +117,7 @@
else
# - Remove $G_FP_DIETPI_USERDATA symlink, if chosen as target
- [[ $TARGET_DIRECTORY == $G_FP_DIETPI_USERDATA ]] && rm $G_FP_DIETPI_USERDATA &> /dev/null
+ [[ $TARGET_DIRECTORY == $G_FP_DIETPI_USERDATA && -L $G_FP_DIETPI_USERDATA ]] && rm $G_FP_DIETPI_USERDATA
mkdir -p "$TARGET_DIRECTORY"
# - Ensure we can create, write and set permissions to target directory
@@ -156,19 +153,19 @@
[[ -f $FP_LOGFILE ]] && rm $FP_LOGFILE
if [[ $LOGFILE_OUTPUT_TEXT ]]; then
- # - Error
+ # Error
if (( $EXIT_CODE )); then
G_DIETPI-NOTIFY 1 "$LOGFILE_OUTPUT_TEXT"
- # - Info
+ # Info
else
G_DIETPI-NOTIFY 2 "$LOGFILE_OUTPUT_TEXT"
fi
- # + Send to logfile
+ # Send to logfile
echo -e "$LOGFILE_OUTPUT_TEXT" > $FP_LOGFILE
fi
diff --git a/dietpi/func/run_ntpd b/dietpi/func/run_ntpd
index a940058508..48c6dc3bae 100644
--- a/dietpi/func/run_ntpd
+++ b/dietpi/func/run_ntpd
@@ -2,7 +2,7 @@
{
#////////////////////////////////////
# DietPi Function:
- # - Update ntpd
+ # - Synchronise system clock with network time
#
#////////////////////////////////////
# Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com
@@ -10,126 +10,107 @@
#////////////////////////////////////
#
# Info:
- # - Launches Systemd-timesyncd time sync update
+ # - Launches systemd-timesyncd for network time sync
#
# Usage:
# - /DietPi/dietpi/func/run_ntpd
# - /DietPi/dietpi/func/run_ntpd 1 | Same as above, resets any pre-existing sucessful synced flag before running
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
G_PROGRAM_NAME='DietPi-Run_NTPD'
G_CHECK_ROOT_USER
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- INPUT=0
- disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1
+ disable_error=1 G_CHECK_VALIDINT "$1" && INPUT=$1 || INPUT=0
EXIT_CODE=1
FP_EXIT_CODE='/DietPi/dietpi/.timesync_exit_status'
-
- #NTP_UPDATE_MODE=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//') # Do not run doubled
- MAX_LOOPS_CHECK=${MAX_LOOPS_CHECK:-60} #*2 = seconds
+ MAX_LOOPS_CHECK=${MAX_LOOPS_CHECK:-60} # seconds
Update_NTPD(){
- #Loop NTP check until sucess, or, non-G_USER_INPUTS and timed out.
- while (( $EXIT_CODE == 1 ))
- do
-
- NTP_UPDATE_MODE=$(grep -m1 '^[[:blank:]]*CONFIG_NTP_MODE=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
-
- #systemd-timesyncd
- if (( $NTP_UPDATE_MODE >= 1 && $NTP_UPDATE_MODE <= 4 )); then
-
- G_RUN_CMD systemctl restart systemd-timesyncd
-
- for ((i=0; i<=$MAX_LOOPS_CHECK; i++))
- do
+ NTP_UPDATE_MODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ # Assume status okay when manual mode is detected
+ if [[ $NTP_UPDATE_MODE != [1-4] ]]; then
- #NB: Following will always report "Synced", once systemd has completed it once
- # - Jessie: "using", Stretch+: "synchronized to"
- if systemctl status systemd-timesyncd | grep -qiE '^[[:blank:]]*status: "(synchronized to|using) time server'; then
+ G_DIETPI-NOTIFY 0 'NTPD: Manual mode detected'
+ EXIT_CODE=0
+ return
- G_DIETPI-NOTIFY 0 'NTPD: systemd-timesyncd synced'
- if (( $NTP_UPDATE_MODE >= 1 && $NTP_UPDATE_MODE <= 3 )); then
-
- systemctl stop systemd-timesyncd
- #systemctl stop systemd-timedated
+ fi
- fi
+ # Loop NTP check until sucess, or, non-G_INTERACTIVE and timeout
+ while (( $EXIT_CODE ))
+ do
- EXIT_CODE=0
- break
+ G_RUN_CMD systemctl restart systemd-timesyncd
- elif (( $i == $MAX_LOOPS_CHECK )); then
+ for ((i=0; i<=$MAX_LOOPS_CHECK; i++))
+ do
- G_DIETPI-NOTIFY 2 'NTPD: time out waiting for systemd-timesyncd'
+ # NB: Following will always report "Synced", once systemd has completed it once
+ if systemctl status systemd-timesyncd | grep -qi '^[[:blank:]]*status: "synchronized to time server'; then
- if (( $G_USER_INPUTS )); then
+ G_DIETPI-NOTIFY 0 'NTPD: systemd-timesyncd synced'
+ (( $NTP_UPDATE_MODE < 4 )) && systemctl stop systemd-timesyncd
+ EXIT_CODE=0
+ break 2
- # - Ask
- G_WHIP_MENU_ARRAY=(
+ elif (( $i == $MAX_LOOPS_CHECK )); then
- 'Retry' ': (Recommended) Rerun network time sync'
- 'NTP mirror' ': Change the NTP mirror used'
- 'NTP mode' ': Change the NTP mode (eg: daemon + drift)'
- 'Override' ': (NOT RECOMMENDED) Ignore failure and override time sync status'
+ G_DIETPI-NOTIFY 2 'NTPD: Timed out waiting for systemd-timesyncd'
- )
+ if [[ $G_INTERACTIVE != 0 ]]; then
- G_WHIP_BUTTON_CANCEL_TEXT='Retry'
- if G_WHIP_MENU 'Network time sync has not yet completed, or, failed to update.\nTo prevent issues with outdated system time during installations, please select an option below.\n
-NB: We highly recommend choosing "Retry" first. Failing that, "NTP mirror" then "NTP mode".\n"Override" is a last resort and may cause follow-up issues due to incorrect system clock time.'; then
+ # Ask
+ G_WHIP_MENU_ARRAY=(
- if [[ $G_WHIP_RETURNED_VALUE == 'NTP mirror' ]]; then
+ 'Retry' ': (Recommended) Rerun network time sync'
+ 'NTP mirror' ': Change the NTP mirror used'
+ 'Override' ': (NOT RECOMMENDED) Ignore failure and override time sync status'
- G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "NTP Mirror"\n - Select a different NTP mirror\n\nOnce completed, exit dietpi-config to resume setup'
- /DietPi/dietpi/dietpi-config 16 1
+ )
- elif [[ $G_WHIP_RETURNED_VALUE == 'NTP mode' ]]; then
+ G_WHIP_BUTTON_CANCEL_TEXT='Retry'
+ if G_WHIP_MENU 'Network time sync has not yet completed, or, failed to update.\nTo prevent issues with outdated system time during installations, please select an option below.\n
+NB: We highly recommend choosing "Retry" first. Failing that, try to change the "NTP mirror".\n"Override" is a last resort and may cause follow-up issues due to incorrect system clock time.'; then
- G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "Time sync mode"\n - Select a different time sync mode (eg: Daemon + Drift)\n\nOnce completed, exit dietpi-config to resume setup'
- /DietPi/dietpi/dietpi-config 3 1
+ if [[ $G_WHIP_RETURNED_VALUE == 'NTP mirror' ]]; then
- elif [[ $G_WHIP_RETURNED_VALUE == 'Override' ]]; then
+ G_WHIP_MSG 'DietPi-Config will now be launched, on the next screen:\n - Select "NTP Mirror"\n - Select a different NTP mirror\n\nOnce completed, exit dietpi-config to resume setup'
+ /DietPi/dietpi/dietpi-config 16 1
- EXIT_CODE=0
- echo 1 > /var/lib/dietpi/.ntpd_override
+ elif [[ $G_WHIP_RETURNED_VALUE == 'Override' ]]; then
- fi
+ EXIT_CODE=0
+ echo 1 > /var/lib/dietpi/.ntpd_override
fi
- # - Automated, allow fail
- else
-
- EXIT_CODE=2 #end loop.
-
fi
+ # Automated, allow fail
else
- G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd ($(( $i + 1 ))/$MAX_LOOPS_CHECK)"
- sleep 2
+ break 2
fi
- done
+ else
- #other method: assume status is ok
- else
+ G_DIETPI-NOTIFY 2 "NTPD: Waiting for completion of systemd-timesyncd ($(( $i + 1 ))/$MAX_LOOPS_CHECK)"
+ sleep 1
- G_DIETPI-NOTIFY 0 'NTPD: manual mode detected'
- EXIT_CODE=0
+ fi
- fi
+ done
done
- # - log status of completion, prevent software installs: https://github.com/MichaIng/DietPi/issues/786
+ # Log status of completion, prevent software installs: https://github.com/MichaIng/DietPi/issues/786
echo $EXIT_CODE > $FP_EXIT_CODE
}
@@ -137,15 +118,8 @@ NB: We highly recommend choosing "Retry" first. Failing that, "NTP mirror" then
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
- #Reset and force new sync?
- if (( $INPUT == 1 )); then
-
- [[ -f $FP_EXIT_CODE ]] && rm $FP_EXIT_CODE
-
- fi
-
- #Only run timesync check once, for each boot session.
- if [[ -f $FP_EXIT_CODE ]] && (( $(<$FP_EXIT_CODE) == 0 )); then
+ # Run timesync only once each boot session, or if $1 == 1 is given
+ if [[ $INPUT != 1 && -f $FP_EXIT_CODE && $(<$FP_EXIT_CODE) == 0 ]]; then
EXIT_CODE=0
@@ -155,25 +129,17 @@ NB: We highly recommend choosing "Retry" first. Failing that, "NTP mirror" then
fi
- #return status
- G_DIETPI-NOTIFY -1 $EXIT_CODE 'NTPD: time sync |'
+ # Return status
+ G_DIETPI-NOTIFY -1 $EXIT_CODE 'NTPD: Network time sync |'
if (( $EXIT_CODE )); then
- if (( $NTP_UPDATE_MODE >= 1 && $NTP_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 'Should never occur'
-
- fi
+ G_DIETPI-NOTIFY 2 'Please check the service status for more information:'
+ G_DIETPI-NOTIFY 2 ' - systemctl status systemd-timesyncd -l'
fi
#-----------------------------------------------------------------------------------
- #return exit code
+ # Return exit code
exit $EXIT_CODE
#-----------------------------------------------------------------------------------
diff --git a/dietpi/misc/dietpi-arr_to_RAM b/dietpi/misc/dietpi-arr_to_RAM
index 66350dd290..5e0feeea67 100644
--- a/dietpi/misc/dietpi-arr_to_RAM
+++ b/dietpi/misc/dietpi-arr_to_RAM
@@ -249,17 +249,15 @@ ExecStop=/bin/dash -c '/DietPi/dietpi/misc/dietpi-arr_to_RAM 0 2>&1 > $FP_LOG'
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
- systemctl enable dietpi-arr_to_RAM || EXIT_CODE=$?
- systemctl start dietpi-arr_to_RAM || EXIT_CODE=$?
+ systemctl enable --now dietpi-arr_to_RAM || EXIT_CODE=$?
}
Disable_On_Boot(){
- if [[ -f /etc/systemd/system/dietpi-arr_to_RAM.service ]]; then
+ if [[ -f '/etc/systemd/system/dietpi-arr_to_RAM.service' ]]; then
- systemctl stop dietpi-arr_to_RAM || EXIT_CODE=$?
- systemctl disable dietpi-arr_to_RAM || EXIT_CODE=$?
+ systemctl disable --now dietpi-arr_to_RAM || EXIT_CODE=$?
rm /etc/systemd/system/dietpi-arr_to_RAM.service || EXIT_CODE=$?
fi
diff --git a/dietpi/misc/dietpi-justboom b/dietpi/misc/dietpi-justboom
index ecd40a0761..a0a4b84062 100644
--- a/dietpi/misc/dietpi-justboom
+++ b/dietpi/misc/dietpi-justboom
@@ -14,36 +14,31 @@
# - /DietPi/dietpi/misc/dietpi-justboom
#////////////////////////////////////
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
. /DietPi/dietpi/func/dietpi-globals
- G_PROGRAM_NAME='DietPi-Justboom'
+ G_PROGRAM_NAME='DietPi-JustBoom'
G_CHECK_ROOT_USER
G_CHECK_ROOTFS_RW
G_INIT
- #Import DietPi-Globals ---------------------------------------------------------------
+ # Import DietPi-Globals --------------------------------------------------------------
- #Prereq ALSA installed from dietpi-software
- if ! dpkg-query -s alsa-utils &> /dev/null; then
+ # Prereq ALSA installed from dietpi-software
+ if [[ ! -f '/etc/asound.conf' ]] || ! dpkg-query -s alsa-utils &> /dev/null; then
- G_WHIP_MSG "$G_PROGRAM_NAME requires ALSA to be installed, before it can be run.\n\nPlease install ALSA, or ideally, an audio application through 'dietpi-software' before use."
- exit 1
-
- elif [ ! -f /etc/asound.conf ]; then
-
- G_WHIP_MSG "$G_PROGRAM_NAME requires an active soundcard to be installed, before it can be run.\n\nPlease use 'dietpi-config' to setup a soundcard for this system."
+ G_WHIP_MSG "$G_PROGRAM_NAME requires ALSA to be installed and a soundcard to be configured.\n
+Please select a soundcard via 'dietpi-config' or install ALSA, or ideally an audio application, through 'dietpi-software' before use."
exit 1
fi
#/////////////////////////////////////////////////////////////////////////////////////
- #Script Globals
+ # Script Globals
#/////////////////////////////////////////////////////////////////////////////////////
EQ_ENABLED=0
SOUNDCARD_CURRENT=0
- SOUNDCARD_CARD_INDEX=0
- [[ -f /etc/asound.conf ]] && SOUNDCARD_CARD_INDEX=$(mawk '/card / {print $2;exit}' /etc/asound.conf)
+ SOUNDCARD_CARD_INDEX=$(mawk '/card / {print $2;exit}' /etc/asound.conf)
- # - MPD
+ # MPD
OUTPUT_FREQ_CURRENT=0
OUTPUT_FREQ_TARGET=0
OUTPUT_BITRATE_CURRENT=0
@@ -56,7 +51,7 @@
MPD_INSTALLED=0
[[ -f $FP_MPD_CONF ]] && MPD_INSTALLED=1
- # - CAVA
+ # CAVA
CAVA_ENABLED=1
CAVA_FRAMERATE=0
CAVA_COLOUR_FG=0
@@ -65,17 +60,16 @@
CAVA_BAR_WIDTH=0
CAVA_MAINSCREENINUSE_DISPLAYED=0
- FP_CAVA_CONF="$HOME/.config/cava/config"
+ FP_CAVA_CONF='/root/.config/cava/config'
CAVA_INSTALLED=0
[[ -f $FP_CAVA_CONF ]] && CAVA_INSTALLED=1
Reset_Globals(){
+ # ALSA EQ levels
+ [[ -f '/root/.alsaequal.bin' ]] && rm /root/.alsaequal.bin
- #ALSA EQ levels
- [[ -f $HOME/.alsaequal.bin ]] && rm $HOME/.alsaequal.bin
-
- #MPD
+ # MPD
OUTPUT_FREQ_TARGET=44100
OUTPUT_BITRATE_TARGET=16
SOXR_ENABLED=0
@@ -83,7 +77,7 @@
EQ_ENABLED=0
MPD_AUDIO_BUFFER_SIZE=2048
- # - Reset CAVA config
+ # Reset CAVA config
cp /var/lib/dietpi/dietpi-software/conf/cava.conf $HOME/.config/cava/config
CAVA_ENABLED=1
@@ -93,7 +87,7 @@
CAVA_BAR_GRAVITY='1.75'
CAVA_BAR_WIDTH=2
- # - Save changes
+ # Save changes
Write_Apply_Globals
}
@@ -102,22 +96,22 @@
SOUNDCARD_CURRENT=$(grep -m1 'CONFIG_SOUNDCARD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- EQ_ENABLED=$(grep -ci -m1 '^pcm.plugequal' /etc/asound.conf)
+ EQ_ENABLED=$(grep -cim1 '^pcm.plugequal' /etc/asound.conf)
- #MPD specific
+ # MPD specific
if (( $MPD_INSTALLED )); then
OUTPUT_FREQ_CURRENT=$(grep -m1 '^format' $FP_MPD_CONF | sed 's/\"//g' | sed 's/:/ /g' | mawk '{print $2}')
OUTPUT_FREQ_TARGET=$OUTPUT_FREQ_CURRENT
OUTPUT_BITRATE_CURRENT=$(grep -m1 '^format' $FP_MPD_CONF | sed 's/\"//g' | sed 's/:/ /g' | mawk '{print $3}')
OUTPUT_BITRATE_TARGET=$OUTPUT_BITRATE_CURRENT
- SOXR_ENABLED=$(grep -ci -m1 '^samplerate_converter \"soxr' $FP_MPD_CONF)
+ SOXR_ENABLED=$(grep -cim1 '^samplerate_converter \"soxr' $FP_MPD_CONF)
SOXR_QUALITY=$(grep -m1 'samplerate_converter \"soxr' $FP_MPD_CONF | sed 's/\"//g' | mawk '{for(i=3;i<=NF;i++){printf "%s ", $i}; printf "\n"}' | sed 's/ *$//')
MPD_AUDIO_BUFFER_SIZE=$(grep -m1 '^audio_buffer_size' $FP_MPD_CONF | mawk '{print $2}' | sed 's/\"//g')
fi
- #CAVA specific
+ # CAVA specific
if (( $CAVA_INSTALLED )); then
CAVA_FRAMERATE=$(mawk '/framerate =/ {print $NF;exit}' $FP_CAVA_CONF)
@@ -142,7 +136,7 @@
fi
- #MPD specific
+ # MPD specific
if (( $MPD_INSTALLED )); then
# - Output freq/bit
@@ -167,7 +161,7 @@
fi
- #CAVA specific
+ # CAVA specific
if (( $CAVA_INSTALLED )); then
G_CONFIG_INJECT 'framerate =' "framerate = $CAVA_FRAMERATE" $FP_CAVA_CONF
@@ -188,12 +182,12 @@
killall -w cava &> /dev/null
- # - Running on current screen
+ # Running on current screen
if (( $CAVA_ENABLED )); then
if [[ $(tty) == '/dev/tty1' ]]; then
- # - display this warning once only
+ # - Display this warning once only
if (( ! $CAVA_MAINSCREENINUSE_DISPLAYED )); then
G_WHIP_MSG "Error:\n\nMain screen in use. To launch CAVA on the main screen, please exit $G_PROGRAM_NAME and run the following command:\n - cava\n\nNB: Press CTRL+C to exit cava."
@@ -204,7 +198,7 @@
else
- setterm -blank 0 -powersave off <> /dev/fb2 >&0 2>&1 #Odroid 3.5 inch
+ setterm -blank 0 -powersave off <> /dev/fb2 >&0 2>&1 # Odroid 3.5 inch
cava <> /dev/console >&0 2>&1 &
fi
@@ -222,17 +216,7 @@
Menu_Exit(){
G_WHIP_SIZE_X_MAX=50
- if G_WHIP_YESNO "Exit $G_PROGRAM_NAME?"; then
-
- #exit
- TARGETMENUID=-1
-
- else
-
- #Return to Main Menu
- TARGETMENUID=0
-
- fi
+ G_WHIP_YESNO "Exit $G_PROGRAM_NAME?" && TARGETMENUID=-1 # Exit
}
@@ -241,20 +225,17 @@
Read_Globals
- local eq_enabled_text='[Off]'
- (( $EQ_ENABLED )) && eq_enabled_text='[On]'
-
- local soxr_enabled_text='[Off]'
- (( $SOXR_ENABLED )) && soxr_enabled_text='[On]'
+ local eq_enabled_text='Off'
+ (( $EQ_ENABLED )) && eq_enabled_text='On'
G_WHIP_MENU_ARRAY=('' '●─ Global Options ')
G_WHIP_MENU_ARRAY+=('ALSA Mixer' ': Launches ALSA Mixer, tweak sound card settings')
G_WHIP_MENU_ARRAY+=('ALSA Output Info' ': View info on current ALSA playback stream')
- G_WHIP_MENU_ARRAY+=("EQ Enable" ": $eq_enabled_text | Select to toggle EQ")
+ G_WHIP_MENU_ARRAY+=("EQ Enable" ": [$eq_enabled_text] | Select to toggle EQ")
(( $EQ_ENABLED )) && G_WHIP_MENU_ARRAY+=('EQ Configure' ': Launches AlsaMixer to configure EQ settings')
G_WHIP_MENU_ARRAY+=('Reset' ': Reset all options to defaults')
- #Allo Piano 2.1 specials
+ # Allo Piano 2.1 specials
if grep -qi 'piano-dac-plus' <<< "$SOUNDCARD_CURRENT"; then
G_WHIP_MENU_ARRAY+=('' '●─ Allo Piano 2.1 ')
@@ -276,16 +257,12 @@
G_WHIP_MENU_ARRAY+=('Subwoofer Mode' ": $subwoofer_mode")
G_WHIP_MENU_ARRAY+=('Subwoofer Volume' ": $subwoofer_volume_int ($subwoofer_volume_db)")
- # - only active with subwoofer 2.1+ modes
- if [[ $subwoofer_mode != '2.0' ]]; then
-
- G_WHIP_MENU_ARRAY+=('Subwoofer Crossover' ": $subwoofer_crossover_frequency Hz")
-
- fi
+ # - Only active with subwoofer 2.1+ modes
+ [[ $subwoofer_mode != '2.0' ]] && G_WHIP_MENU_ARRAY+=('Subwoofer Crossover' ": $subwoofer_crossover_frequency Hz")
fi
- #MPD specific
+ # MPD specific
if (( $MPD_INSTALLED )); then
G_WHIP_MENU_ARRAY+=('' '●─ MPD Specific ')
@@ -293,12 +270,14 @@
G_WHIP_MENU_ARRAY+=('Output BitRate' ": $OUTPUT_BITRATE_CURRENT Bit | Select to change")
G_WHIP_MENU_ARRAY+=('Audio Buffer' ": $MPD_AUDIO_BUFFER_SIZE Bytes | Select to change")
- G_WHIP_MENU_ARRAY+=('SOXR Enable' ": $soxr_enabled_text | Select to toggle SOXR resampling")
+ local soxr_enabled_text='Off'
+ (( $SOXR_ENABLED )) && soxr_enabled_text='On'
+ G_WHIP_MENU_ARRAY+=('SOXR Enable' ": [$soxr_enabled_text] | Select to toggle SOXR resampling")
(( $SOXR_ENABLED )) && G_WHIP_MENU_ARRAY+=('SOXR Quality' ": $SOXR_QUALITY | Select SOXR quality level")
fi
- #CAVA specific
+ # CAVA specific
if (( $CAVA_INSTALLED )); then
G_WHIP_MENU_ARRAY+=('' '●─ CAVA Specific ')
@@ -314,18 +293,17 @@
fi
- G_WHIP_DEFAULT_ITEM="$LAST_SELECTED_NAME"
+ G_WHIP_DEFAULT_ITEM=$LAST_SELECTED_NAME
G_WHIP_BUTTON_CANCEL_TEXT='Exit'
if G_WHIP_MENU 'Tweak your High-End Audiophile JustBoom (and others) sound card:'; then
- LAST_SELECTED_NAME="$G_WHIP_RETURNED_VALUE"
+ LAST_SELECTED_NAME=$G_WHIP_RETURNED_VALUE
if [[ $G_WHIP_RETURNED_VALUE == 'ALSA Output Info' ]]; then
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 ""
+ local stream_result=$( 1 )) && EQ_ENABLED=0
-
+ (( $EQ_ENABLED )) && EQ_ENABLED=0 || EQ_ENABLED=1
Write_Apply_Globals
elif [[ $G_WHIP_RETURNED_VALUE == 'SOXR Enable' ]]; then
- ((SOXR_ENABLED++))
- (( $SOXR_ENABLED > 1 )) && SOXR_ENABLED=0
-
+ (( $SOXR_ENABLED )) && SOXR_ENABLED=0 || SOXR_ENABLED=1
Write_Apply_Globals
elif [[ $G_WHIP_RETURNED_VALUE == 'SOXR Quality' ]]; then
@@ -636,7 +600,7 @@
)
- G_WHIP_DEFAULT_ITEM="$SOXR_QUALITY"
+ G_WHIP_DEFAULT_ITEM=$SOXR_QUALITY
if G_WHIP_MENU 'Please select a SOXR quality level:'; then
SOXR_QUALITY=$G_WHIP_RETURNED_VALUE
@@ -659,7 +623,7 @@
)
- G_WHIP_DEFAULT_ITEM="$MPD_AUDIO_BUFFER_SIZE"
+ G_WHIP_DEFAULT_ITEM=$MPD_AUDIO_BUFFER_SIZE
if G_WHIP_MENU 'Please select a audio buffer size (bytes):'; then
MPD_AUDIO_BUFFER_SIZE=$G_WHIP_RETURNED_VALUE
@@ -682,7 +646,7 @@
)
- G_WHIP_DEFAULT_ITEM="$OUTPUT_FREQ_CURRENT"
+ G_WHIP_DEFAULT_ITEM=$OUTPUT_FREQ_CURRENT
if G_WHIP_MENU 'Please select a output frequency:'; then
OUTPUT_FREQ_TARGET=$G_WHIP_RETURNED_VALUE
@@ -700,7 +664,7 @@
)
- G_WHIP_DEFAULT_ITEM="$OUTPUT_BITRATE_CURRENT"
+ G_WHIP_DEFAULT_ITEM=$OUTPUT_BITRATE_CURRENT
if G_WHIP_MENU 'Please select a output bitrate:'; then
OUTPUT_BITRATE_TARGET=$G_WHIP_RETURNED_VALUE
@@ -732,7 +696,7 @@
while (( $TARGETMENUID >= 0 ))
do
- (( $TARGETMENUID == 0 )) && Menu_Main
+ Menu_Main
done
#-----------------------------------------------------------------------------------
diff --git a/dietpi/misc/dietpi-nordvpn b/dietpi/misc/dietpi-nordvpn
index 87ea008833..7233112628 100644
--- a/dietpi/misc/dietpi-nordvpn
+++ b/dietpi/misc/dietpi-nordvpn
@@ -10,37 +10,54 @@
#
# Info:
# - GUI to setup a NordVPN connection
- # - Automatically starts service during boot
- # Usage:
- # - /DietPi/dietpi/misc/dietpi-nordvpn
- #////////////////////////////////////
+ # - Allows to automatically connect on boot
+ # - Allows to add post-up and pre-down scripts
+ USAGE='
+Usage: dietpi-nordvpn []
+Available commands:
+ Interactive menu to edit, connect and apply NordVPN settings
+ status Print NordVPN connection status info
+' #////////////////////////////////////
+
+ # Grab Inputs
+ INPUT=$1
# Import DietPi-Globals --------------------------------------------------------------
- . /DietPi/dietpi/func/dietpi-globals
- G_PROGRAM_NAME='DietPi-NordVPN'
- G_CHECK_ROOT_USER
- G_CHECK_ROOTFS_RW
- G_INIT
+ # - Only load for interactive menu
+ if [[ $INPUT ]]; then
+
+ G_PROGRAM_NAME='DietPi-NordVPN'
+
+ else
+
+ . /DietPi/dietpi/func/dietpi-globals
+ G_PROGRAM_NAME='DietPi-NordVPN'
+ G_CHECK_ROOT_USER
+ G_CHECK_ROOTFS_RW
+ G_INIT
+
+ fi
# Import DietPi-Globals --------------------------------------------------------------
FP_SETTINGS_DIETPI='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf'
FP_SETTINGS_OVPN='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_ovpn.conf'
+ FP_SETTINGS_UP='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/up.sh'
+ FP_SETTINGS_DOWN='/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/down.sh'
NORDVPN_USERNAME=''
NORDVPN_PASSWORD=''
NORDVPN_SERVER=''
PROTOCOL='udp'
- NET_DEV='tun0'
+ IFACE='tun0'
+ MAX_WAIT_FOR_CONNECTION=5 # seconds
+ NORDVPN_INSTALLED=0
NORDVPN_SERVICE=0
NORDVPN_CONNECTED=0
- MAX_WAIT_FOR_CONNECTION=5
WAN_IP=''
+ RX='N/A'
+ TX='N/A'
- Update_Wan_Ip(){
-
- WAN_IP=$(curl -sLm 2 https://dietpi.com/myip.php 2>&1)
-
- }
+ Update_Wan_Ip(){ WAN_IP=$(curl -sSfLm 2 https://dietpi.com/myip.php 2>&1); }
Init(){
@@ -48,40 +65,64 @@
until grep -q 'aSOFTWARE_INSTALL_STATE\[171\]=2' /DietPi/dietpi/.installed
do
- if G_WHIP_YESNO "$G_PROGRAM_NAME is not installed, would you like to install it now?"; then
+ # Offer install only for interactive menu
+ if [[ ! $INPUT ]] && G_WHIP_YESNO "$G_PROGRAM_NAME is not installed, would you like to install it now?"; then
/DietPi/dietpi/dietpi-software install 171
else
- TARGETMENUID=-1 #Exit path without save.
- break
+ TARGETMENUID=-1 # Skip menu
+ return
fi
done
+ NORDVPN_INSTALLED=1
# Check service exists
- [[ -f '/lib/systemd/system/dietpi-nordvpn.service' ]] && NORDVPN_SERVICE=1
-
- Read_Settings
+ [[ -f '/etc/systemd/system/dietpi-nordvpn.service' ]] && NORDVPN_SERVICE=1
}
Check_Connected(){
- NORDVPN_CONNECTED=0
- #if systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'; then
- ip r s dev $NET_DEV &>/dev/null && NORDVPN_CONNECTED=1
-
+ #systemctl status dietpi-nordvpn | grep -qi 'initialization sequence completed'
+ ip r s dev $IFACE &> /dev/null && NORDVPN_CONNECTED=1 || NORDVPN_CONNECTED=0
return $(( ! $NORDVPN_CONNECTED ))
}
+ Get_Connection_Info(){
+
+ RX='N/A'
+ if [[ -f /sys/class/net/$IFACE/statistics/rx_bytes ]]; then
+
+ local rx=$( $FP_SETTINGS_OVPN
@@ -95,18 +136,23 @@ NORDVPN_PASSWORD='${NORDVPN_PASSWORD//\'/\'\\\'\'}'
NORDVPN_SERVER='$NORDVPN_SERVER'
PROTOCOL='$PROTOCOL'
_EOF_
- G_CONFIG_INJECT 'auth-user-pass' "auth-user-pass $FP_SETTINGS_OVPN" /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER
- chmod 600 $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER
- chown root:root $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER
+ local fp_ovpn="/etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER"
+ chmod 600 $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI $fp_ovpn
+ chown root:root $FP_SETTINGS_OVPN $FP_SETTINGS_DIETPI $fp_ovpn
+
+ G_CONFIG_INJECT 'auth-user-pass([[:blank:]]|$)' "auth-user-pass $FP_SETTINGS_OVPN" $fp_ovpn
+ [[ -f $FP_SETTINGS_UP || -f $FP_SETTINGS_DOWN ]] && G_CONFIG_INJECT 'script-security[[:blank:]]' 'script-security 2' $fp_ovpn 'auth[[:blank:]]'
+ [[ -f $FP_SETTINGS_UP ]] && G_CONFIG_INJECT 'route-up[[:blank:]]' "route-up $FP_SETTINGS_UP" $fp_ovpn 'auth[[:blank:]]' || sed -i '/^[[:blank:]]*route-up[[:blank:]]/d' $fp_ovpn
+ [[ -f $FP_SETTINGS_DOWN ]] && G_CONFIG_INJECT 'route-pre-down[[:blank:]]' "route-pre-down $FP_SETTINGS_DOWN" $fp_ovpn 'auth[[:blank:]]' || sed -i '/^[[:blank:]]*route-pre-down[[:blank:]]/d' $fp_ovpn
- cat << _EOF_ > /lib/systemd/system/dietpi-nordvpn.service
+ cat << _EOF_ > /etc/systemd/system/dietpi-nordvpn.service
[Unit]
Description=NordVPN (DietPi)
After=network.target dietpi-boot.service
[Service]
-ExecStart=$(command -v openvpn) /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER
+ExecStart=$(command -v openvpn) $fp_ovpn
[Install]
WantedBy=multi-user.target
@@ -115,23 +161,25 @@ _EOF_
NORDVPN_SERVICE=1
G_RUN_CMD systemctl restart dietpi-nordvpn
- for (( i=1; i<=$MAX_WAIT_FOR_CONNECTION; i++ ))
+ local i=1
+ until Check_Connected || (( $i > $MAX_WAIT_FOR_CONNECTION ))
do
- if Check_Connected; then
+ G_DIETPI-NOTIFY -2 "Waiting for connection ($((i++))/$MAX_WAIT_FOR_CONNECTION)"
+ sleep 1
- break
+ done
- else
+ if (( $NORDVPN_CONNECTED )); then
- G_DIETPI-NOTIFY 2 "Waiting for connection ($i/$MAX_WAIT_FOR_CONNECTION)"
- sleep 1
+ G_DIETPI-NOTIFY 0 "Connection established: $NORDVPN_SERVER"
- fi
+ else
- done
+ G_DIETPI-NOTIFY 1 "Connection failed/timeout: $NORDVPN_SERVER"
+ G_WHIP_MSG "Connection failed/timeout: $NORDVPN_SERVER\n\nPlease verify account details are correct.\n\nIf problems persist, please check the service status: \"systemctl -l status dietpi-nordvpn\""
- (( $NORDVPN_CONNECTED )) || G_WHIP_MSG "Connection failed/time out: $NORDVPN_SERVER\n\nPlease verify account details are correct.\n\nIf problems persist, please check the status of 'systemctl status dietpi-nordvpn -l'"
+ fi
}
@@ -151,36 +199,19 @@ _EOF_
# TARGETMENUID=0
Menu_Main(){
- Update_Wan_Ip
-
- local text_status="Status:\n - WAN IP: $WAN_IP\n"
- if (( $NORDVPN_SERVICE )) && Check_Connected; then
-
- text_status+=" - Connected : $NORDVPN_SERVER\n"
-
- local net_rx_byte=0
- local net_tx_byte=0
- local net_rx_mb='N/A'
- local net_tx_mb='N/A'
+ local text_status="WAN IP : $WAN_IP\nState : "
+ if (( ! $NORDVPN_SERVICE )); then
- if [[ -f /sys/class/net/$NET_DEV/statistics/rx_bytes && -f /sys/class/net/$NET_DEV/statistics/tx_bytes ]]; then
+ text_status+='Not configured\nSubscription : https://go.nordvpn.net/aff_c?offer_id=15&aff_id=5305&url_id=902'
- net_rx_byte=$( $fp
+ nano $fp
+ (( $(stat -c %s $fp) )) && chmod 700 $fp || rm $fp
elif [[ $G_WHIP_RETURNED_VALUE == 'Auto start' ]]; then
@@ -236,11 +279,12 @@ _EOF_
elif [[ $G_WHIP_RETURNED_VALUE == 'Disconnect' ]]; then
G_RUN_CMD systemctl stop dietpi-nordvpn
+ Update_Wan_Ip
LAST_SELECTED_NAME='Refresh'
elif [[ $G_WHIP_RETURNED_VALUE == 'Server' ]]; then
- # - Select protocol
+ # Select protocol
G_WHIP_MENU_ARRAY=(
'UDP' ': Recommended'
@@ -251,20 +295,22 @@ _EOF_
G_WHIP_DEFAULT_ITEM=$PROTOCOL
G_WHIP_MENU 'Please select the connection protocol type:' && PROTOCOL=${G_WHIP_RETURNED_VALUE,,}
- # - Select server
+ # Select server
G_DIETPI-NOTIFY 2 'Populating NordVPN server list, please wait...'
- cd /etc/openvpn/ovpn_$PROTOCOL
G_WHIP_MENU_ARRAY=()
- for i in *
+ for i in /etc/openvpn/ovpn_$PROTOCOL/*.ovpn
do
- G_WHIP_MENU_ARRAY+=("$i" '')
+ G_WHIP_MENU_ARRAY+=("${i##*/}" '')
done
- cd /tmp/$G_PROGRAM_NAME
G_WHIP_DEFAULT_ITEM=$NORDVPN_SERVER
- G_WHIP_MENU 'Please select a NordVPN server to use' && NORDVPN_SERVER=$G_WHIP_RETURNED_VALUE
+ G_WHIP_MENU 'Please select a NordVPN server to use:' && NORDVPN_SERVER=$G_WHIP_RETURNED_VALUE
+
+ elif [[ $G_WHIP_RETURNED_VALUE == 'Refresh' ]]; then
+
+ Update_Wan_Ip
fi
@@ -282,12 +328,46 @@ _EOF_
#-----------------------------------------------------------------------------------
Init
#-----------------------------------------------------------------------------------
- while (( $TARGETMENUID >= 0 ))
- do
+ if [[ $INPUT == 'status' ]]; then
+
+ if (( ! $NORDVPN_INSTALLED )); then
+
+ echo -e "\e[33m$G_PROGRAM_NAME is not installed! Please run: \"dietpi-software install 171\"\e[0m"
+
+ elif (( ! $NORDVPN_SERVICE )); then
+
+ echo -e "\e[33m$G_PROGRAM_NAME is not configured! Please run: \"dietpi-nordvpn\"\e[0m"
+
+ elif ! Check_Connected; then
- (( $TARGETMENUID == 0 )) && Menu_Main
+ echo -e '\e[1;31mDisconnected\e[0m'
+
+ else
+
+ Get_Connection_Info
+ echo -e "\e[1;32mConnected\e[0m - Sent = $TX | Received = $RX"
+
+ fi
+
+ elif [[ $INPUT ]]; then
+
+ # Unknown input
+ echo -e "\e[90m[\e[0m\e[31mFAILURE\e[0m\e[90m]\e[0m \e[90m$G_PROGRAM_NAME | \e[0mInvalid input command ($INPUT). Aborting...\n$USAGE"
+ exit 1
+
+ else
+
+ Read_Settings
+ Update_Wan_Ip
+
+ while (( $TARGETMENUID >= 0 ))
+ do
+
+ Menu_Main
+
+ done
- done
+ fi
#-----------------------------------------------------------------------------------
exit
#-----------------------------------------------------------------------------------
diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi
index 657128d012..3bf8394a0f 100644
--- a/dietpi/misc/start_kodi
+++ b/dietpi/misc/start_kodi
@@ -17,16 +17,16 @@
#////////////////////////////////////
# Import DietPi-Globals --------------------------------------------------------------
# G_HW_MODEL required only
- G_HW_MODEL=$(sed -n 1p /DietPi/dietpi/.hw_model)
+ G_HW_MODEL=$(mawk 'NR==1 {print}' /DietPi/dietpi/.hw_model)
# Import DietPi-Globals --------------------------------------------------------------
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
- # Raspberry Pi
+ # RPi
if (( $G_HW_MODEL < 10 )); then
- kodi-standalone
+ kodi --standalone
# Everything else
# - From desktop
diff --git a/dietpi/patch_file b/dietpi/patch_file
index ee0534de35..3d58414f93 100644
--- a/dietpi/patch_file
+++ b/dietpi/patch_file
@@ -178,14 +178,14 @@
G_WHIP_MSG 'Notice (locale):\n\nTo resolve broken locales, they have been reset to "en_GB.UTF-8".\n\nIf you had a different locale configured on this system, please use "dietpi-config" at a later date to re-configure.\n\nIn relation to that, DietPi does not use "/etc/environment" anymore, thus it is cleaned. In case you manually edited it, a backup was created: /mnt/dietpi_userdata/environment.bak'
#------------------------------------------------------------------------------
- #Removed control from DietPi-Services: https://github.com/MichaIng/DietPi/issues/1501
- systemctl enable dnsmasq &> /dev/null; systemctl start dnsmasq &> /dev/null
- systemctl enable openvpn &> /dev/null; systemctl start openvpn &> /dev/null
+ # Removed control from DietPi-Services: https://github.com/MichaIng/DietPi/issues/1501
+ systemctl enable --now dnsmasq &> /dev/null
+ systemctl enable --now openvpn &> /dev/null
#-------------------------------------------------------------------------------
- #https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10646
+ # https://dietpi.com/phpbb/viewtopic.php?f=11&t=2772&p=10646#p10646
[[ -f '/etc/apt/sources.list.d/openmediavault.list' ]] && rm /etc/apt/sources.list.d/openmediavault.list
#-------------------------------------------------------------------------------
- #DietPi-Software removals: https://github.com/MichaIng/DietPi/issues/1491
+ # DietPi-Software removals: https://github.com/MichaIng/DietPi/issues/1491
if [[ -f /DietPi/dietpi/.installed ]]; then
sed -i '/^aSOFTWARE_INSTALL_STATE\[100\]=/c\aSOFTWARE_INSTALL_STATE\[100\]=0' /DietPi/dietpi/.installed # Grashopper (now pijuice)
@@ -199,7 +199,7 @@
fi
#-------------------------------------------------------------------------------
- #Nodered lacks homedir, create it: https://github.com/MichaIng/DietPi/issues/1446#issuecomment-366370800
+ # Nodered lacks homedir, create it: https://github.com/MichaIng/DietPi/issues/1446#issuecomment-366370800
if getent passwd nodered &> /dev/null && [[ ! -d '/home/nodered' ]]; then
mkdir -p /home/nodered
@@ -207,17 +207,19 @@
fi
#-------------------------------------------------------------------------------
- #Reinstalls:
+ # Reinstalls:
# v6.20 NetData 1.9
#-------------------------------------------------------------------------------
elif (( $G_DIETPI_VERSION_SUB == 2 )); then
#-------------------------------------------------------------------------------
- #Switch from rc.local to own postboot script: https://github.com/MichaIng/DietPi/issues/1376
- G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/mnt/dietpi_userdata/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.'
- [[ -f '/etc/rc.local' ]] && mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak
- cat << _EOF_ > /etc/rc.local
+ # Switch from rc.local to own postboot script: https://github.com/MichaIng/DietPi/issues/1376
+ if [[ -f '/etc/rc.local' ]]; then
+
+ G_WHIP_MSG 'DietPi will not use "/etc/rc.local" for its own scripts anymore.\n\nHowever, in case you manually added something, we safe a backup to "/mnt/dietpi_userdata/rc.local.bak", from where you can copy & paste back to the cleaned "/etc/rc.local".\n\nIt will work as before.'
+ mv /etc/rc.local /mnt/dietpi_userdata/rc.local.bak
+ cat << _EOF_ > /etc/rc.local
#!/bin/sh -e
#
# rc.local
@@ -233,7 +235,9 @@
exit 0
_EOF_
- chmod +x /etc/rc.local
+ chmod +x /etc/rc.local
+
+ fi
systemctl enable dietpi-postboot
@@ -242,7 +246,7 @@ _EOF_
[[ -d '/var/lib/dietpi/postboot.d' ]] || mkdir /var/lib/dietpi/postboot.d
cat << _EOF_ > /var/lib/dietpi/postboot.d/moode
#!/bin/bash
-#moOde additions
+# moOde additions
SQLDB=/var/local/www/db/moode-sqlite3.db
# set cpu govenor
@@ -255,13 +259,13 @@ _EOF_
fi
#-------------------------------------------------------------------------------
- G_DIETPI-NOTIFY 2 'Reducing getty count and resource usage:'
+ G_DIETPI-NOTIFY 2 'Reducing getty count and resource usage'
systemctl mask getty-static
#-------------------------------------------------------------------------------
- # - Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302
+ # Meveric, update repo to use our EU mirror: https://github.com/MichaIng/DietPi/issues/1519#issuecomment-368234302
sed -i 's@https://oph.mdrjr.net/meveric@http://fuzon.co.uk/meveric@' /etc/apt/sources.list.d/meveric* &> /dev/null
#-------------------------------------------------------------------------------
- #Remove any existing apt recommends settings, before applying ours: https://github.com/MichaIng/DietPi/issues/1482#issuecomment-368031044
+ # Remove any existing apt recommends settings, before applying ours: https://github.com/MichaIng/DietPi/issues/1482#issuecomment-368031044
rm -f /etc/apt/apt.conf.d/*recommends*
G_ERROR_HANDLER_COMMAND='/etc/apt/apt.conf.d/99-dietpi-norecommends'
@@ -274,7 +278,7 @@ _EOF_
G_ERROR_HANDLER_EXITCODE=$?
G_ERROR_HANDLER
#-------------------------------------------------------------------------------
- #Reinstalls:
+ # Reinstalls:
# v6.5 Shairport-sync 3.1.7
# RPi Cam
# Aria2 for .conf addition: https://github.com/MichaIng/DietPi/issues/1575#issuecomment-370248708
@@ -290,31 +294,21 @@ _EOF_
fi
#-------------------------------------------------------------------------------
- #Add certificate combining for Lighttpd to CertBot auto renewal: https://github.com/MichaIng/DietPi/pull/1553
+ # Add certificate combining for Lighttpd to Certbot auto renewal: https://github.com/MichaIng/DietPi/pull/1553
if [[ -f '/DietPi/dietpi/.dietpi-letsencrypt' ]]; then
- # - Switch Minio to new certbot.service.d/ hook:
- if (( $G_DISTRO > 3 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[158\]=2' /DietPi/dietpi/.installed; then
+ # Switch Minio to new certbot.service.d/ hook:
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[158\]=2' /DietPi/dietpi/.installed; then
- [[ -f /etc/systemd/system/certbot.service ]] && rm /etc/systemd/system/certbot.service
+ [[ -f '/etc/systemd/system/certbot.service' ]] && rm /etc/systemd/system/certbot.service
fi
- # - Overall settings and config renewal:
- /DietPi/dietpi/dietpi-letsencrypt 1
- # - Stop services, started during dietpi-letsencrypt execution:
- /DietPi/dietpi/dietpi-services stop
+ # Overall settings and config renewal, skip DietPi-Services:
+ G_DIETPI_SERVICES_DISABLE=1 /DietPi/dietpi/dietpi-letsencrypt 1
fi
#-------------------------------------------------------------------------------
- #Sparky SBC kernel patches: Pro-Ject-S2 dac DSD native support on sparky, also other few dac ids.
- if (( $G_HW_MODEL == 70 )); then
-
- G_RUN_CMD wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/pro-ject-s2/snd-usb-audio.ko -O /lib/modules/$(uname -r)/kernel/sound/usb/snd-usb-audio.ko
- G_RUN_CMD wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/pro-ject-s2/snd-usbmidi-lib.ko -O /lib/modules/$(uname -r)/kernel/sound/usb/snd-usbmidi-lib.ko
-
- fi
- #-------------------------------------------------------------------------------
- #GNU key management required for some APT installs via additional repos: https://github.com/MichaIng/DietPi/issues/1388
+ # GNU key management required for some APT installs via additional repos: https://github.com/MichaIng/DietPi/issues/1388
G_AGI dirmngr
#-------------------------------------------------------------------------------
# Odroids FFmpeg decendency fix: https://github.com/MichaIng/DietPi/issues/1556#issuecomment-369463910
@@ -454,15 +448,7 @@ _EOF_
#Reinstall firmware-misc-nonfree by default (ralink): https://github.com/MichaIng/DietPi/issues/1675
if dpkg-query -s wpasupplicant &> /dev/null; then
- if (( $G_DISTRO == 3 )); then
-
- G_AGI firmware-ralink
-
- else
-
- G_AGI firmware-misc-nonfree
-
- fi
+ G_AGI firmware-misc-nonfree
elif (( $G_HW_ARCH == 10 && $G_HW_MODEL != 20 )); then
@@ -545,16 +531,14 @@ _EOF_
# v2: https://github.com/MichaIng/DietPi/pull/1779
if (( $G_HW_MODEL == 70 )) && grep -qi 'CONFIG_SOUNDCARD=usb-dac' /DietPi/dietpi.txt; then
- cat << _EOF_ > /var/lib/dietpi/postboot.d/sparky_unmute.sh
-#!/bin/bash
-for x in \`amixer controls | grep layback\`
-do
+ for x in $(amixer -c $SOUNDCARD_TARGET_CARD controls | grep layback)
+ do
- amixer cset "\${x}" 100% &> /dev/null
+ amixer -c $SOUNDCARD_TARGET_CARD cset "$x" 100%
-done
-alsactl store &> /dev/null
-_EOF_
+ done
+ alsactl store
+ systemctl restart alsa-restore
fi
#-------------------------------------------------------------------------------
@@ -618,18 +602,10 @@ _EOF_
done
- fi
- #-------------------------------------------------------------------------------
- #Disable "initial_turbo" option for RPi within config.txt, as it currently prevents CPU throttle down: https://github.com/MichaIng/DietPi/issues/1836
- if [[ -f '/DietPi/config.txt' ]] && grep -q '^[[:blank:]]*initial_turbo' /DietPi/config.txt; then
-
- sed -i '/^[[:blank:]]*initial_turbo/d' /DietPi/config.txt
- echo -e '\n# Initial turbo currently leads to CPU not being throttled down by CPU governor: https://github.com/MichaIng/DietPi/issues/1836\n#initial_turbo=20' >> /DietPi/config.txt
-
fi
#-------------------------------------------------------------------------------
#Remove config.txt for non-RPi devices: https://github.com/MichaIng/DietPi/pull/1863
- (( $G_HW_MODEL >= 10 )) && rm -f /{DietPi,boot}/config.txt
+ (( $G_HW_MODEL > 9 )) && rm -f /{DietPi,boot}/config.txt
#-------------------------------------------------------------------------------
#Removal of NTP from dietpi-software
sed -i '/^aSOFTWARE_INSTALL_STATE\[106\]=/c\aSOFTWARE_INSTALL_STATE\[106\]=0' /DietPi/dietpi/.installed &> /dev/null
@@ -658,10 +634,6 @@ _EOF_
fi
#-------------------------------------------------------------------------------
- #Reset DietPi-Survey settings file due to rework with v6.9 and v6.10
- # - pre-v6.17 dietpi-update rerun assures, dietpi-survey is called after update has finished
- [[ -f /DietPi/dietpi/.dietpi-survey ]] && rm /DietPi/dietpi/.dietpi-survey
- #-------------------------------------------------------------------------------
elif (( $G_DIETPI_VERSION_SUB == 10 )); then
@@ -743,9 +715,6 @@ _EOF_
fi
#-------------------------------------------------------------------------------
- # - ARM64 packages no longer available: https://github.com/MichaIng/DietPi/issues/1915
- (( $G_DISTRO < 4 && $G_HW_ARCH == 3 )) && sed -i '/debian-security/d' /etc/apt/sources.list
- #-------------------------------------------------------------------------------
#Fix Xserver uninstall issus by not purging dependencies, but leaving them for autoremove: https://github.com/MichaIng/DietPi/pull/1930/files
local dpkg_list=$(dpkg --get-selections)
grep -q '^xinit[[:space:]]' <<< "$dpkg_list" && apt-mark auto xauth x11-common
@@ -794,8 +763,7 @@ _EOF_
#Mask systemd-logind as new default, if libpam-systemd is not installed: https://github.com/MichaIng/DietPi/issues/1767
if ! dpkg-query -s 'libpam-systemd' &> /dev/null; then
- systemctl stop systemd-logind &> /dev/null
- systemctl disable systemd-logind &> /dev/null
+ systemctl disable --now systemd-logind &> /dev/null
systemctl mask systemd-logind
fi
@@ -870,7 +838,8 @@ _EOF_
unset pw_dietpi_software
fi
- /DietPi/dietpi/func/dietpi-set_software setpermissions
+ chown root:root /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
+ chmod 600 /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin
#-------------------------------------------------------------------------------
#BruteFIR removal
sed -i '/^aSOFTWARE_INSTALL_STATE\[38\]=/c\aSOFTWARE_INSTALL_STATE\[38\]=0' /DietPi/dietpi/.installed &> /dev/null
@@ -918,10 +887,9 @@ _EOF_
done
chmod +x /etc/network/if-up.d/dietpi-disable_offload
#-------------------------------------------------------------------------------
- #Sparky kernel update: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz
+ # Sparky USB driver update: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz
if (( $G_HW_MODEL == 70 )); then
- # patches
G_RUN_CMD wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dsd-marantz/snd-usb-audio.ko -O /lib/modules/3.10.38/kernel/sound/usb/snd-usb-audio.ko
G_RUN_CMD wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dsd-marantz/snd-usbmidi-lib.ko -O /lib/modules/3.10.38/kernel/sound/usb/snd-usbmidi-lib.ko
@@ -1020,7 +988,7 @@ We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing
if (( ! $? )) && (( ! $G_WHIP_RETURNED_VALUE )); then
# - Remove kernel module blacklisting
- rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf &> /dev/null
+ [[ -f '/etc/modprobe.d/99-dietpi-blacklist-ipv6.conf' ]] && rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf
# - Failsafe: Comment "blacklist ipv6" entries in all other sysctl config files
local i=''
for i in /etc/modprobe.d/*
@@ -1104,24 +1072,24 @@ ExecStart=/usr/local/bin/sparky_eth_controller.sh
[Install]
WantedBy=multi-user.target
_EOF_
- systemctl enable sparky_eth_controller.service
+ systemctl enable sparky_eth_controller
cat << _EOF_ > /usr/local/bin/sparky_eth_controller.sh
#!/bin/bash
-#We need to wait until USB eth is established on USB bus. This takes much longer than onboard init and network.target network-pre.target
+# We need to wait until USB eth is established on USB bus. This takes much longer than onboard init and network.target network-pre.target
sleep 20
# - Set USB ETH if found
-if ip a | grep -qi 'eth1'; then
+if ip a s eth1 &> /dev/null; then
echo 'blacklist ethernet' > /etc/modprobe.d/disable_sparkysbc_ethernet.conf
- rm /etc/udev/rules.d/70-persist{e,a}nt-net.rules &> /dev/null
+ rm -f /etc/udev/rules.d/70-persist{e,a}nt-net.rules
reboot
# - Enable onboard ETH if no adapter found
-elif ! ip a | grep -qi 'eth0'; then
+elif ! ip a s eth0 &> /dev/null; then
- rm /etc/modprobe.d/disable_sparkysbc_ethernet.conf &> /dev/null
- rm /etc/udev/rules.d/70-persist{e,a}nt-net.rules &> /dev/null
+ [[ -f '/etc/modprobe.d/disable_sparkysbc_ethernet.conf' ]] && rm /etc/modprobe.d/disable_sparkysbc_ethernet.conf
+ rm -f /etc/udev/rules.d/70-persist{e,a}nt-net.rules
reboot
fi
@@ -1131,10 +1099,7 @@ _EOF_
fi
systemctl daemon-reload
#-------------------------------------------------------------------------------
- #Failsafe, assure /var/tmp 777 permissions: https://github.com/MichaIng/DietPi/issues/1144#issuecomment-425758727
- chmod 777 /var/tmp
- #-------------------------------------------------------------------------------
- #Remove obsolete EMR patch file and redo removal of obsolete script files, as they were not removed from disk: https://github.com/MichaIng/DietPi/pull/2123#issuecomment-428121908
+ # Remove obsolete EMR patch file and redo removal of obsolete script files, as they were not removed from disk: https://github.com/MichaIng/DietPi/pull/2123#issuecomment-428121908
for i in /{DietPi,boot}/dietpi
do
@@ -1149,7 +1114,7 @@ _EOF_
done
#-------------------------------------------------------------------------------
- #Remove www-data under sudo without PW: https://github.com/MichaIng/DietPi/issues/2121
+ # Remove www-data under sudo without PW: https://github.com/MichaIng/DietPi/issues/2121
sed -i '/^www-data ALL=NOPASSWD: ALL/d' /etc/sudoers
#-------------------------------------------------------------------------------
@@ -1157,12 +1122,12 @@ _EOF_
#-------------------------------------------------------------------------------
# - Remove mysql.service as we use mariadb.service, both cannot exist: https://github.com/MichaIng/DietPi/issues/1913#issuecomment-441343798
- if [[ -f '/etc/init.d/mysql' ]] && (( $G_DISTRO >= 4 )); then
+ if [[ -f '/etc/init.d/mysql' ]]; then
G_DIETPI-NOTIFY 2 'Switching from /etc/init.d/mysql to mariadb.service'
- killall -w mariadb &> /dev/null #failsafe
- killall -w mysqld &> /dev/null #failsafe
+ killall -w mariadb &> /dev/null # failsafe
+ killall -w mysqld &> /dev/null # failsafe
systemctl stop mysql
rm /etc/init.d/mysql
systemctl daemon-reload
@@ -1188,7 +1153,7 @@ _EOF_
/DietPi/dietpi/dietpi-software reinstall 106 121 123 144 145
# - Switch to "mariadb" systemd service on Stretch+: https://github.com/MichaIng/DietPi/pull/2196
- if (( $G_DISTRO > 3 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[88\]=2' /DietPi/dietpi/.installed; then
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[88\]=2' /DietPi/dietpi/.installed; then
G_WHIP_MSG '[ INFO ] Switch from "mysql" to "mariadb" service\n
On Stretch (and above) systems, DietPi-Services will use the pre-installed "mariadb" systemd service now, instead of the obsolete "mysql" init.d service.\n
@@ -1399,15 +1364,6 @@ Pin-Priority: -1' > /etc/apt/preferences.d/dietpi-docker_fix
#.dietpi-autostart_index removal, if zero: https://github.com/MichaIng/DietPi/pull/2343
[[ -f '/DietPi/dietpi/.dietpi-autostart_index' ]] && (( $( /etc/apt/preferences.d/dietpi-wireguard
-
fi
#-------------------------------------------------------------------------------
#MPD: Fix permissions issue: https://github.com/MichaIng/DietPi/issues/2462
@@ -1600,28 +1540,11 @@ _EOF_
rm /etc/X11/xorg.conf
G_AGI --reinstall firmware-samsung xf86-video-armsoc-odroid malit628-odroid
- fi
- #-------------------------------------------------------------------------------
- #DietPi-Survey: Remove survey sent count from settings file: https://github.com/MichaIng/DietPi/pull/2626
- if [[ -f '/DietPi/dietpi/.dietpi-survey' ]]; then
-
- local survey_opted_in=$(sed -n 1p /DietPi/dietpi/.dietpi-survey)
- echo $survey_opted_in > /DietPi/dietpi/.dietpi-survey
-
fi
#-------------------------------------------------------------------------------
#RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635
(( $G_HW_MODEL < 10 )) && sed -i '/framebuffer_depth/d' /DietPi/config.txt
#-------------------------------------------------------------------------------
- #Tiny fix for Beta users on Jessie system to switch global PW to sha256 digest, since related pre-patch is not re-run on RC-only updates: https://github.com/MichaIng/DietPi/commit/70e0a664d5b12954d673cde3f20224547ed8d549
- local global_pw=''
- if (( $G_DISTRO < 4 )) &&
- global_pw=$(openssl enc -d -a -md md5 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then
-
- openssl enc -e -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $global_pw
-
- fi
- #-------------------------------------------------------------------------------
#Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638
if [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] &&
! grep -q 'oc[ms]-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then
@@ -1742,20 +1665,10 @@ NB: When accessing "deluge-console" you need to do that as user "debian-deluged"
if (( $G_DIETPI_INSTALL_STAGE == 2 )); then
# Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698
- # - Skip on Jessie: https://github.com/MichaIng/DietPi/issues/2689#issuecomment-487306241
- if (( $G_DISTRO > 3 )) && grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed; then
-
- G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n
+ grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /DietPi/dietpi/.installed && G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n
With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n
This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n
Further info and usage: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5828'
- #-----------------------------------------------------------------------
- # Jessie C1 switch to Stretch | should not occur for pre-patch compatible versions and auto switch over to jessie-support for existing installs.
- elif (( $G_HW_MODEL == 10 )); then
-
- G_WHIP_MSG '[INFO] Odroid C1 image has been updated to Stretch. Please upgrade to continue limited support for this device:\nhttps://github.com/MichaIng/DietPi/issues/2561#issuecomment-488685121'
-
- fi
#-----------------------------------------------------------------------
# Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691
if [[ -f '/etc/wireguard/wg0.conf' ]] && ! grep -q 'sysctl' /etc/wireguard/wg0.conf; then
@@ -1905,11 +1818,10 @@ Your Nextcloud data are not touched.'
[[ -L '/var/subsonic/transcode' ]] && rm /var/subsonic/transcode
# Plex Media Server: https://github.com/MichaIng/DietPi/pull/2722
dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer
- [[ -f '/etc/apt/sources.list.d/plex.list' ]] && rm /etc/apt/sources.list.d/plex.list
# Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4
if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then
- systemctl disable squeezeboxserver
+ systemctl disable --now squeezeboxserver
mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service
fi
@@ -1952,8 +1864,7 @@ opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.sav
# Upgrade Nextcloud
if (( $upgrade_nextcloud )); then
- local mariadb='mariadb'; (( $G_DISTRO < 4 )) && mariadb='mysql'
- G_RUN_CMD systemctl start $mariadb redis-server
+ G_RUN_CMD systemctl start mariadb redis-server
ncc upgrade
ncc db:add-missing-indices
ncc db:convert-filecache-bigint
@@ -2022,7 +1933,7 @@ Use "dietpi-config" to adjust these settings to your needs.'
# DietPi-Survey now uses dietpi.txt for opt in/out state
if [[ -f '/DietPi/dietpi/.dietpi-survey' ]]; then
- G_CONFIG_INJECT 'SURVEY_OPTED_IN=' "SURVEY_OPTED_IN=$( /etc/systemd/system/node-red.service|i\mkdir -p $G_FP_DIETPI_USERDATA/node-red' /DietPi/dietpi/dietpi-software
- #-------------------------------------------------------------------------------
# Reinstalls:
# O!MPD update to master: https://github.com/MichaIng/DietPi/pull/2884
# myMPD update to master: https://github.com/MichaIng/DietPi/pull/2883
@@ -2143,6 +2043,288 @@ A backup will be created to "/etc/mympd/mympd.conf.bak_DDMMYYY_N" from where you
fi
#-------------------------------------------------------------------------------
+ elif (( $G_DIETPI_VERSION_SUB == 25 )); then
+
+ #-------------------------------------------------------------------------------
+ # Remove possible OpenMediaVault leftovers, that are not part of current OMV packages, thus save to remove: https://github.com/MichaIng/DietPi/issues/2994
+ [[ -f '/etc/cron.d/openmediavault-rrdtoolgraph' ]] && rm /etc/cron.d/openmediavault-rrdtoolgraph
+ [[ -f '/usr/sbin/omv-mkgraph' ]] && rm /usr/sbin/omv-mkgraph
+ #-------------------------------------------------------------------------------
+ # Disable pihole.log query logging: https://github.com/pi-hole/FTL/issues/614#issuecomment-510564476
+ command -v pihole &> /dev/null && pihole -l off
+ #-------------------------------------------------------------------------------
+ # Remove obsolete audio related services/scripts/settings: https://github.com/MichaIng/DietPi/pull/2988
+ # RPi: Remove invalid I2C baudrate entries from config.txt. Do no apply any value to preserve current system state (default): https://github.com/MichaIng/DietPi/issues/2966
+ # RPi: Remove obsolete camera module entry, which is loaded by default since kernel 4.19, instead add a blacklist entry if camera is disabled.
+ # RPi: Further config.txt fixes: https://github.com/MichaIng/DietPi/pull/3000
+ if [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]]; then
+
+ alsactl store
+ systemctl restart alsa-restore
+ rm /var/lib/dietpi/postboot.d/sparky_unmute.sh
+
+ fi
+ [[ -f '/etc/systemd/system/rpi-bcm2835_forced_3.5mm.service' ]] && rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service
+ if (( $G_HW_MODEL < 10 )); then
+
+ sed -i '/dtoverlay=i2s-mmap/d' /DietPi/config.txt
+ sed -i '/dtoverlay=i2s=/d' /DietPi/config.txt
+ sed -i '/dtoverlay=lirc-rpi/d' /DietPi/config.txt
+ sed -i '/^[[:blank:]#]*dtparam=gpio_in_pin=25/d' /DietPi/config.txt
+ sed -i '/^[[:blank:]#]*i2c_arm_baudrate=/d' /DietPi/config.txt
+ sed -i '/^[[:blank:]#]*bcm2835-v4l2/d' /etc/modules
+ grep -q '^[[:blank:]]*start_x=1' /DietPi/config.txt || /DietPi/dietpi/func/dietpi-set_hardware rpi-camera disable
+ if [[ -f '/etc/modprobe.d/disable_bt.conf' ]]; then
+
+ G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /DietPi/config.txt
+ dtoverlay disable-bt
+
+ fi
+ if [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]]; then
+
+ G_CONFIG_INJECT 'dtoverlay=disable-wifi' 'dtoverlay=disable-wifi' /DietPi/config.txt
+ dtoverlay disable-wifi
+
+ fi
+ # Offer re-adding of "initial_turbo" on RPi: https://github.com/MichaIng/DietPi/issues/3147
+ if ! grep -q '^[[:blank:]]*initial_turbo' /DietPi/config.txt; then
+
+ sed -i '\|issues/1836|d' /DietPi/config.txt # Remove obsolete comment
+ G_WHIP_BUTTON_OKAY_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO 'Re-adding "initial_turbo" option\n
+The firmware issues with the "initial_turbo" option have been fixed a recent update: https://github.com/raspberrypi/firmware/issues/1005\n
+This option allows you to force highest CPU frequency for a set amount of seconds during boot. This significantly reduces boot time on RPi since it by default boots with lowest frequencies, until a systemd unit sets the chosen CPU governor at later boot stage. You can now set this setting again via:
+ - dietpi-config > Performance Options > ARM Initial Turbo\n
+Do you want to have the recommended "initial_turbo=20" re-added to your config.txt now?' && G_CONFIG_INJECT 'initial_turbo=' 'initial_turbo=20' /DietPi/config.txt
+
+ fi
+
+ fi
+ #-------------------------------------------------------------------------------
+ # Docker: Remove obsolete RPi workaround, since a new version has been released
+ [[ -f '/etc/apt/preferences.d/dietpi-docker_fix' ]] && rm /etc/apt/preferences.d/dietpi-docker_fix
+ #-------------------------------------------------------------------------------
+ # Config file renaming: https://github.com/MichaIng/DietPi/pull/3000
+ [[ -f '/etc/modprobe.d/disable_bt.conf' ]] && mv /etc/modprobe.d/disable_bt.conf /etc/modprobe.d/dietpi-disable_bluetooth.conf
+ [[ -f '/etc/modprobe.d/disable_wifi.conf' ]] && mv /etc/modprobe.d/disable_wifi.conf /etc/modprobe.d/dietpi-disable_wifi.conf
+ [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]] && rm /etc/modprobe.d/disable_wifi_rpi3_onboard.conf
+ for i in '8192cu' '8188eu' '8189es' '8723bs' 'wlan_8192eu'
+ do
+
+ [[ -f /etc/modprobe.d/${i}.conf ]] || continue
+ cat /etc/modprobe.d/${i}.conf >> /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf
+ rm /etc/modprobe.d/${i}.conf
+
+ done
+ #-------------------------------------------------------------------------------
+ # Remove old scripts/files that have been removed from code source long time ago but never from updated systems
+ rm -f /{DietPi,boot}/dietpi/func/dietpi-set_{curlftpfs,nfsclient,smbclient}
+ rm -f /{DietPi,boot}/dietpi/.dietpi-backup_{include,exclude}
+ [[ -f '/var/log/boottime' ]] && rm /var/log/boottime # https://github.com/MichaIng/DietPi/commit/e6713f874cac47ef11912e3455bf1abe58bfd412
+ #-------------------------------------------------------------------------------
+ # Move DietPi-NordVPN service to /etc/systemd/system: https://github.com/MichaIng/DietPi/pull/3084
+ [[ -f '/lib/systemd/system/dietpi-nordvpn.service' ]] && mv /lib/systemd/system/dietpi-nordvpn.service /etc/systemd/system/dietpi-nordvpn.service && systemctl daemon-reload
+ #-------------------------------------------------------------------------------
+ # RPi
+ # - Replace haveged with rng-tools, which is proven to work on RPi, is default on Raspbian and uses less RAM on idle
+ # - Fix headless mode
+ # - Remove obsolete Kodi repo for Beta testers + replace obsolete kodi-rpi4 package with new official Kodi from RPi repository
+ # - On RPi4 raise temp_limit from 65°C tp 75°C as new default value: https://github.com/MichaIng/DietPi/issues/3151
+ if (( $G_HW_MODEL < 10 )); then
+
+ systemctl disable --now haveged 2> /dev/null
+ G_AGP haveged
+ G_AGI rng-tools
+ if grep -q '^[[:blank:]]*hdmi_ignore_hotplug=1' /DietPi/config.txt && grep -q '^[[:blank:]]*hdmi_ignore_composite=1' /DietPi/config.txt; then
+
+ /DietPi/dietpi/func/dietpi-set_hardware headless enable
+ tvservice -o
+
+ fi
+ sed -i '/hdmi_ignore_composite/d' /DietPi/config.txt
+ rm -f /etc/apt/sources.list.d/{dietpi-kodi,pipplware,kodi}.list
+ if dpkg-query -s kodi-rpi4 &> /dev/null; then
+
+ G_DIETPI-NOTIFY 2 'Replacing obsolete kodi-rpi4 package with new official Kodi from RPi repository...'
+ G_AGP kodi-rpi4
+ mkdir -p /etc/polkit-1/localauthority/50-local.d # https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241
+ G_AGI kodi
+
+ fi
+ (( $G_HW_MODEL == 4 )) && grep -q '^[[:blank:]]*temp_limit=65' /DietPi/config.txt && G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /DietPi/config.txt
+
+ # Rock(Pro)64: Apply workaround for kernel-related Ethernet issues: https://github.com/MichaIng/DietPi/issues/3066
+ elif [[ $G_HW_MODEL == 4[23] ]]; then
+
+ local identifier='ff540000'
+ (( $G_HW_MODEL == 43 )) && identifier='fe300000'
+
+ if [[ -f '/boot/boot.cmd' ]] && ! grep -q "$identifier" /boot/boot.cmd; then
+
+ sed -i "/^fdt resize/{s/$/\
+fdt rm /ethernet@$identifier rockchip,bugged_tx_coe\
+fdt rm /ethernet@$identifier snps,force_thresh_dma_mode\
+fdt set /ethernet@$identifier snps,txpbl <0x21>/;q}" /boot/boot.cmd
+ mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
+
+ fi
+
+ fi
+ #-------------------------------------------------------------------------------
+ # Run "setupcon --save" to force font and cached console+keyboard script renewal. This solves an issue on Buster, where the "console-setup" service fails to do this on boot in cases: https://github.com/MichaIng/DietPi/issues/2912#issuecomment-532100542
+ command -v setupcon &> /dev/null && setupcon --save
+ #-------------------------------------------------------------------------------
+ # Failsafe, assure /var/tmp 1777 permissions: https://github.com/MichaIng/DietPi/issues/1144#issuecomment-517338321
+ chmod 1777 /var/tmp
+ #-------------------------------------------------------------------------------
+ # Reinstalls and software install changes
+ if (( $G_DIETPI_INSTALL_STAGE == 2 )); then
+
+ # Remove obsolete install states: TightVPN and SDL2
+ sed -Ei '/^aSOFTWARE_INSTALL_STATE\[(27|140)\]=/d' /DietPi/dietpi/.installed
+
+ # Gogs: Remove /etc/__MACOSX that comes from our archive on ARMv6
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[49\]=2' /DietPi/dietpi/.installed; then
+
+ [[ $G_HW_ARCH == 1 && -d '/etc/__MACOSX' ]] && rm -R /etc/__MACOSX
+
+ fi
+ # Pi-hole: Update blocking page implementation and webserver configs: https://github.com/MichaIng/DietPi/pull/3072
+ if [[ -f '/etc/pihole/pihole-FTL.conf' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[93\]=2' /DietPi/dietpi/.installed; then
+
+ [[ -L '/var/www/index.php' && $(readlink -f '/var/www/index.php') == '/var/www/html/pihole/index.php' ]] && rm /var/www/index.php
+ if command -v a2ensite &> /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /DietPi/dietpi/.installed; then
+
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -O /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -O /etc/apache2/sites-available/dietpi-pihole.conf
+ a2ensite dietpi-pihole
+ if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then
+
+ [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak
+ G_CONFIG_INJECT 'ErrorDocument 404' 'ErrorDocument 404 /html/pihole/index.php' /etc/apache2/sites-available/dietpi-pihole.conf
+
+ fi
+
+ fi
+ if command -v lighttpd-enable-mod &> /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[84\]=2' /DietPi/dietpi/.installed; then
+
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -O /etc/lighttpd/conf-available/99-dietpi-pihole.conf
+ lighttpd-enable-mod dietpi-pihole
+ if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then
+
+ [[ -f '/var/www/index.lighttpd.html' ]] && mv /var/www/index.lighttpd.html /var/www/index.lighttpd.html.bak
+ G_CONFIG_INJECT 'server.error-handler-404' 'server.error-handler-404 = "/html/pihole/index.php"' /etc/lighttpd/conf-available/99-dietpi-pihole.conf
+
+ fi
+
+ fi
+ if [[ -d '/etc/nginx/sites-dietpi' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[85\]=2' /DietPi/dietpi/.installed; then
+
+ # Update Nginx default vhost, which is required to assure access restrictions for Pi-hole
+ G_BACKUP_FP /etc/nginx/sites-available/default
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -O /etc/nginx/sites-available/default
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -O /etc/nginx/sites-dietpi/dietpi-pihole.conf
+ if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then
+
+ [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak
+ G_CONFIG_INJECT 'error_page 404' 'error_page 404 /html/pihole/index.php;' /etc/nginx/sites-dietpi/dietpi-pihole.conf
+
+ fi
+
+ fi
+ systemctl is-enabled dhcpcd &> /dev/null && ! pgrep dhcpcd &> /dev/null &> /dev/null && systemctl disable dhcpcd
+
+ fi
+ # X11: Fix drivers and config on Odroid C2: https://github.com/MichaIng/DietPi/issues/3028
+ if (( $G_HW_MODEL == 12 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[6\]=2' /DietPi/dietpi/.installed; then
+
+ G_BACKUP_FP /etc/X11/xorg.conf
+ G_RUN_CMD wget "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -O /etc/X11/xorg.conf
+ apt-mark auto xf86-video-mali-odroid
+ # Kodi: Remove PulseAudio, not required by Kodi anymore, but ask user first
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[31\]=2' /DietPi/dietpi/.installed; then
+
+ G_WHIP_YESNO 'PulseAudio was installed together with Kodi, but it is not required anymore. If you did not install it manually for a special purpose, it is safe to remove it.\n
+Do you want to keep PulseAudio installed?' || apt-mark auto pulseaudio
+
+ fi
+ G_AGA
+ G_AGI --reinstall aml-libs-odroid mali450-odroid libump-odroid xf86-video-fbturbo-odroid
+
+ fi
+ # myMPD: https://github.com/MichaIng/DietPi/pull/3110
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[148\]=2' /DietPi/dietpi/.installed; then
+
+ # NB: On Debian Buster by default /lib is a symlink to /usr/lib, thus the below fails as both files are the same. However it does not hurt and assures no obsolete service file will be left (after uninstall).
+ if [[ -f '/usr/lib/systemd/system/mympd.service' ]]; then
+
+ mv /usr/lib/systemd/system/mympd.service /lib/systemd/system/mympd.service 2> /dev/null
+ systemctl daemon-reload
+
+ fi
+ [[ -f '/etc/systemd/systemd/mympd.service.d/dietpi-group.conf' ]] && rm /etc/systemd/systemd/mympd.service.d/dietpi-group.conf
+ [[ -d '/etc/systemd/systemd/mympd.service.d' ]] && rmdir --ignore-fail-on-non-empty /etc/systemd/systemd/mympd.service.d
+
+ fi
+ # Fail2Ban: Enable service since it is not controlled by DietPi-Services anymore: https://github.com/MichaIng/DietPi/commit/4d6ccbeee47b54247613f880a03339ff8a72f24d
+ grep -q '^aSOFTWARE_INSTALL_STATE\[73\]=2' /DietPi/dietpi/.installed && systemctl enable --now fail2ban
+ # Certbot: https://github.com/MichaIng/DietPi/issues/3111
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[92\]=2' /DietPi/dietpi/.installed; then
+
+ # Apache
+ if grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /DietPi/dietpi/.installed; then
+
+ G_AGI python3-certbot-apache
+ grep -q '^[[:blank:]]*authenticator[[:blank:]]*=[[:blank:]]*webroot' /etc/letsencrypt/renewal/*.conf 2> /dev/null &&
+ G_WHIP_YESNO '[Certbot] Switch back to native Apache authentication method\n
+Your Certbot authenticates with the "webroot" method, while you have an Apache webserver installed. This was required some time ago due to a sudden change by Let'\''s Encrypt, which made the Apache authentication method fail.
+Meanwhile, with current Certbot version, this bug has been fixed and we got some reports where the webroot method does not work reliable instead, leaving you with an expired HTTPS certificate in cases.\n
+Would you like to switch back to the Apache authentication method now?' && certbot renew --force-renewal -a apache
+
+ # Nginx
+ elif grep -q '^aSOFTWARE_INSTALL_STATE\[85\]=2' /DietPi/dietpi/.installed; then
+
+ G_AGI python3-certbot-nginx
+ grep -q '^[[:blank:]]*authenticator[[:blank:]]*=[[:blank:]]*webroot' /etc/letsencrypt/renewal/*.conf 2> /dev/null &&
+ G_WHIP_YESNO '[Certbot] Switch back to native Nginx authentication method\n
+Your Certbot authenticates with the "webroot" method, while you have an Nginx webserver installed. This was required some time ago due to a sudden change by Let'\''s Encrypt, which made the Nginx authentication method fail.
+Meanwhile, with current Certbot version, this bug has been fixed and we got some reports where the webroot method does not work reliable instead, leaving you with an expired HTTPS certificate in cases.\n
+Would you like to switch back to the Nginx authentication method now?' && certbot renew --force-renewal -a nginx
+
+ fi
+
+ fi
+ # Mono: Use new Buster repo on Buster/Bullseye systems
+ (( $G_DISTRO > 4 )) && [[ -f '/etc/apt/sources.list.d/mono-xamarin.list' ]] && sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/mono-xamarin.list
+ # Aria2: https://github.com/MichaIng/DietPi/pull/3139
+ if [[ -f '/var/lib/dietpi/dietpi-software/installed/aria2.conf' ]]; then
+
+ # If aria2.conf exists on new location, it must have been installed with new code already, thus old file is obsolete.
+ if [[ -f $G_FP_DIETPI_USERDATA/aria2/aria2.conf ]]; then
+
+ rm /var/lib/dietpi/dietpi-software/installed/aria2.conf
+
+ else
+
+ # Apply session save/resume feature but do not overwrite existing settings
+ GCI_PRESERVE=1 G_CONFIG_INJECT 'input-file=' 'input-file=/mnt/dietpi_userdata/downloads/aria2.session' /var/lib/dietpi/dietpi-software/installed/aria2.conf
+ local fp_input=$(sed -n '/^[[:blank:]]*input-file=/{s/^[^=]*=//p;q}' /var/lib/dietpi/dietpi-software/installed/aria2.conf)
+ GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session=' "save-session=$fp_input" /var/lib/dietpi/dietpi-software/installed/aria2.conf
+ GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session-interval=' 'save-session-interval=60' /var/lib/dietpi/dietpi-software/installed/aria2.conf
+ # Move aria2.conf to new location
+ mkdir -p $G_FP_DIETPI_USERDATA/aria2
+ mv /var/lib/dietpi/dietpi-software/installed/aria2.conf $G_FP_DIETPI_USERDATA/aria2/
+
+ fi
+
+ fi
+ # Webmin: https://github.com/MichaIng/DietPi/commit/ec55d49a488fd9cb1dbb18cbfa067b5d1d1a974e
+ /DietPi/dietpi/dietpi-software reinstall 115 132
+
+ fi
+ #-------------------------------------------------------------------------------
+
fi
#-------------------------------------------------------------------------------
diff --git a/dietpi/postboot b/dietpi/postboot
index ac910ca00b..7e6b88b25d 100644
--- a/dietpi/postboot
+++ b/dietpi/postboot
@@ -10,28 +10,24 @@
#
# Info:
# - Filename: /{DietPi,boot}/dietpi/postboot
- # - Finishes boog logs
+ # - Moves boot logs from /tmp to persistent dir
# - DietPi-Update check and DietPi-Services start on regular boot
# - Executes optional user scripts from: /var/lib/dietpi/postboot.d/
+ # - Prints login banner
#////////////////////////////////////
- # Safe boot time to log
- mawk '{print $1 " Seconds"}' /proc/uptime > /var/log/boottime &
+ G_DIETPI_INSTALL_STAGE=$( /dev/null &
- /DietPi/dietpi/dietpi-update 2 &> /dev/null &
-
- fi
-
- # - Start DietPi controlled services
+ # Start DietPi controlled services
/DietPi/dietpi/dietpi-services start
fi
@@ -50,9 +46,11 @@
# Print DietPi login banner if no autologin selected
if [[ ! -f '/etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf' ]]; then
- echo -e '\n'
+ echo
/DietPi/dietpi/func/dietpi-banner 0
- echo -e ' Default Login:\n Username = root\n Password = dietpi\n\n Please login to continue\n'
+ # Print default login credentials only on first boot
+ [[ $G_DIETPI_INSTALL_STAGE == 2 ]] || echo -e '\n Default Login:\n Username = root\n Password = dietpi (or custom dietpi.txt entry)'
+ echo -e '\n Please hit to login\n'
fi
diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file
index 35d0bfd08e..8d7c050da3 100644
--- a/dietpi/pre-patch_file
+++ b/dietpi/pre-patch_file
@@ -18,12 +18,6 @@
# - ./pre-patch_file $G_DIETPI_VERSION_SUB
#////////////////////////////////////
- EXIT_CODE=0
-
- echo -e '\n \e[38;5;154mDietPi-Pre-patch\e[0m
-\e[90m─────────────────────────────────────────────────────
- Mode: \e[0mApplying pre-patches\n'
-
# Grab input, being failsafe when applying to $G_DIETPI_VERSION_SUB
if [[ $1 =~ ^-?[0-9]+$ ]]; then
@@ -31,141 +25,187 @@
else
- echo -e "\e[90m[\e[0m\e[31mFAILED\e[0m\e[90m]\e[0m No valid input used: $1"
- EXIT_CODE=1
+ echo -e "\e[90m[\e[0m\e[31mFAILED\e[0m\e[90m]\e[0m Invalid input argument ($1)"
+ exit -1
fi
#///////////////////////////////////////////////////////////////////////////////
# Main loop
#///////////////////////////////////////////////////////////////////////////////
+ #-------------------------------------------------------------------------------
+ # Pre-patch 1: RAMlog 0 free space check due to issues with failing DietPi cron jobs in v6.11
+ if (( $G_DIETPI_VERSION_SUB < 12 && $(df -m --output=avail /var/log | tail -1) < 2 )); then
- until (( $EXIT_CODE ))
- do
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 1 | Clearing /var/log files to free up RAMlog space (<2MB) before update will continue'
+ /DietPi/dietpi/func/dietpi-logclear 1 || exit 1
- #-------------------------------------------------------------------------------
- # Pre-patch 1: RAMlog 0 free space check due to issues with failing DietPi cron jobs in v6.11
- if (( $G_DIETPI_VERSION_SUB < 12 && $(df -B1M --output=avail /var/log | sed -n 2p) < 2 )); then
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 2: https://github.com/MichaIng/DietPi/pull/2490
+ if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f '/etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf' ]] && grep -qi 'buster' /etc/os-release; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 1 | Clearing /var/log files to free up RAMlog space (<2MB) before update will continue'
- /DietPi/dietpi/func/dietpi-logclear 1 || { EXIT_CODE=1; break; }
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support'
+ sed -i '/innodb_large_prefix/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || exit 2
+ sed -i '/innodb_file_format/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || exit 2
- fi
- #-------------------------------------------------------------------------------
- # Pre-patch 2: https://github.com/MichaIng/DietPi/pull/2490
- if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f '/etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf' ]] &&
- grep -qi 'buster' /etc/os-release; then
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 3: https://github.com/MichaIng/DietPi/issues/2213
+ if (( $G_DIETPI_VERSION_SUB < 22 )) &&
+ GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc -nosalt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then
+
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security'
+ grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2=''
+ openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || exit 3
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support'
- sed -i '/innodb_large_prefix/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || { EXIT_CODE=2; break; }
- sed -i '/innodb_file_format/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || { EXIT_CODE=2; break; }
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656
+ # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings
+ if (( $G_DIETPI_VERSION_SUB < 23 )); then
- fi
- #-------------------------------------------------------------------------------
- # Pre-patch 3: https://github.com/MichaIng/DietPi/issues/2213
- if (( $G_DIETPI_VERSION_SUB < 22 )) &&
- GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc -nosalt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then
+ if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security'
- grep -qi 'buster' /etc/os-release && pbkdf2='-iter 10000' || pbkdf2=''
- openssl enc -e -a -md sha256 -aes-256-cbc $pbkdf2 -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< $GLOBAL_PW || { EXIT_CODE=3; break; }
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages'
+ echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n
+Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || exit 4
fi
- #-------------------------------------------------------------------------------
- # Pre-patch 4: https://github.com/MichaIng/DietPi/issues/2656
- # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings
- if (( $G_DIETPI_VERSION_SUB < 23 )); then
- if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then
+ grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || exit 5
+ grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || exit 5
+
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 6: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332
+ if grep -qi 'jessie' /etc/os-release; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 4 | Hardening Debian Sid repo usage to prevent accidental distro upgrades but allow auto-upgrades for WireGuard packages'
- echo -e 'Package: *\nPin: release n=sid\nPin-Priority: -1\n
-Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || { EXIT_CODE=4; break; }
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 6 | Migrating Jessie systems to "jessie-support" update branch'
+ if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then
- fi
+ sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt
- grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=5' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; }
- grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=3' >> /DietPi/dietpi.txt || { EXIT_CODE=5; break; }
+ else
+
+ echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt
fi
- #-------------------------------------------------------------------------------
- # Pre-patch 6: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332
- # Pre-patch 7: https://github.com/MichaIng/DietPi/pull/2728
- if grep -qi 'jessie' /etc/os-release; then
- if ! grep -q '^[[:blank:]]*DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt; then
+ # Remove DietPi-Update working directory to allow concurrent execution.
+ cd /tmp
+ [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update
+
+ # Apply update forcefully, since user has already chosen to do so.
+ /DietPi/dietpi/dietpi-update 1
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Migrating Jessie systems to "jessie-support" update branch'
- if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then
+ # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish.
+ kill $PPID
+ exit
- sed -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 8: https://github.com/MichaIng/DietPi/issues/2795
+ if (( $G_DIETPI_VERSION_SUB < 24 )) && [[ -f '/etc/apt/preferences.d/dietpi-openssl' ]]; then
- else
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 8 | Patching PHP APT repo preferences to prevent possible APT upgrade issues'
+ echo -e '# libssl1.1 from sury.org breaks Lighttpd install
+Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-openssl || exit 8
- echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 9: https://github.com/MichaIng/DietPi/issues/2808
+ if (( $G_DIETPI_VERSION_SUB < 25 )) && [[ -f '/etc/apt/preferences.d/dietpi-php' ]]; then
- fi
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 9 | Patching Buster APT repo preferences to prevent possible APT issues'
+ echo -e '# Allow to install PHP7.3 dependencies and meta packages from Buster
+# - Lighttpd must be pulled as well from Buster since the Stretch version does not support Buster libssl1.1 (1.1.1)
+Package: php libapache2-mod-php php-* libssl* libc6* libc-* libgssapi-krb5-2 libpcre2-8-0 libk5crypto3 libkrb5-3 libkrb5support0 locales libzip4 curl libcurl4-openssl-dev lighttpd
+Pin: release n=buster\nPin-Priority: 501\n
+# Pin down all other Buster packages to only allow upgrades of already installed ones via: "apt upgrade"
+Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-php || exit 9
+
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 10: https://github.com/MichaIng/DietPi/pull/3020
+ if (( $G_DIETPI_VERSION_SUB < 26 )) && command -v xrdp &> /dev/null && grep -qi 'stretch' /etc/os-release; then
+
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 10 | Allow upgrade of XRDP from backports to resolve certain issues with current Stretch version'
+ cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp || exit 10
+Package: xrdp
+Pin: release n=stretch-backports
+Pin-Priority: 500
+_EOF_
- # Remove DietPi-Update working directory to allow concurrent execution.
- cd /tmp
- [[ -d '/tmp/DietPi-Update' ]] && rm -R /tmp/DietPi-Update
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 11: https://github.com/MichaIng/DietPi/issues/3029
+ if (( $G_DIETPI_VERSION_SUB < 26 )) && [[ -f '/etc/apt/sources.list.d/sonarr.list' ]]; then
+
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 11 | Updating Sonarr APT repository key'
+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493 || exit 11
- # Apply update forcefully, since user has already chosen to do so.
- /DietPi/dietpi/dietpi-update 1
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 12: https://github.com/MichaIng/DietPi/issues/3038
+ if (( $G_DIETPI_VERSION_SUB < 23 )) && [[ -f '/etc/apt/sources.list.d/plex.list' ]] && grep -q 'dev2day' /etc/apt/sources.list.d/plex.list; then
- # Kill parental dietpi-update instance and exit this script to avoid deprecated update finish.
- kill $PPID
- exit
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 12 | Removing obsolete dev2day repo for Plex Media Server, replaced by the new official APT repo'
+ rm /etc/apt/sources.list.d/plex.list || exit 12
- fi
+ fi
+ #-------------------------------------------------------------------------------
+ # Pre-patch 13/14: https://github.com/MichaIng/DietPi/issues/3131#issuecomment-536997267
+ # Pre-patch 15: WireGuard: Enable auto-rebuild after kernel upgrades on RPi
+ # Pre-patch 16: https://github.com/MichaIng/DietPi/pull/2571
+ # Pre-patch 17: https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241
+ if (( $G_DIETPI_VERSION_SUB < 26 )); then
+
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 13 | Disabling dpkg status file translations by default, which have hardly any use, but raise APT update times + disk I/O '
+ echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/98-dietpi-no_translations || exit 13
- if (( $G_DIETPI_VERSION_SUB < 23 && $(sed -n 1p /DietPi/dietpi/.hw_model) > 9 )); then
+ if [[ -f '/etc/apt/sources.list.d/dietpi-wireguard.list' ]]; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 7 | Applying changes to APT sources.list since Debian dropped support for Jessie systems'
- if [[ $(uname -m) == 'aarch64' ]]; then
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 14 | Switch to "bullseye" repo for WireGuard installs'
+ # RPi
+ if (( $(mawk 'NR==1' /DietPi/dietpi/.hw_model || mawk 'NR==1' /boot/dietpi/.hw_model) < 10 )); then
- echo 'deb http://archive.debian.org/debian/ main contrib non-free' > /etc/apt/sources.list || { EXIT_CODE=7; break; }
+ echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list || exit 14
- else
+ if command -v wg &> /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[172\]=2' /DietPi/dietpi/.installed; then
- sed -Ei '/jessie-(backports|updates)/d' /etc/apt/sources.list || { EXIT_CODE=7; break; }
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 15 | Enable WireGuard auto-rebuild after kernel upgrades on RPi'
+ echo -e '#!/bin/dash\ndpkg-reconfigure wireguard-dkms' > /etc/kernel/postinst.d/dietpi-wireguard || exit 15
fi
+ # non-RPi
+ else
+
+ echo 'deb https://deb.debian.org/debian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list || exit 14
+
fi
fi
- #-------------------------------------------------------------------------------
- # Pre-patch 8: https://github.com/MichaIng/DietPi/issues/2795
- if (( $G_DIETPI_VERSION_SUB < 24 )) && [[ -f '/etc/apt/preferences.d/dietpi-openssl' ]]; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 8 | Patching PHP APT repo preferences to prevent possible APT upgrade issues'
- echo -e '# libssl1.1 from sury.org breaks Lighttpd install
-Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-openssl || { EXIT_CODE=8; break; }
+ if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then
+
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 16 | Harden "bullseye" repo preferences for WireGuard installs'
+ echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n
+Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-Priority: 99' > /etc/apt/preferences.d/dietpi-wireguard || exit 16
fi
- #-------------------------------------------------------------------------------
- # Pre-patch 9: https://github.com/MichaIng/DietPi/issues/2808
- if (( $G_DIETPI_VERSION_SUB < 25 )) && [[ -f '/etc/apt/preferences.d/dietpi-php' ]]; then
- echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 9 | Patching Buster APT repo preferences to prevent possible APT issues'
- echo -e '# Allow to install PHP7.3 dependencies and meta packages from Buster
-# - Lighttpd must be pulled as well from Buster since the Stretch version does not support Buster libssl1.1 (1.1.1)
-Package: php libapache2-mod-php php-* libssl* libc6* libc-* libgssapi-krb5-2 libpcre2-8-0 libk5crypto3 libkrb5-3 libkrb5support0 locales libzip4 curl libcurl4-openssl-dev lighttpd
-Pin: release n=buster\nPin-Priority: 501\n
-# Pin down all other Buster packages to only allow upgrades of already installed ones via: "apt upgrade"
-Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-php || { EXIT_CODE=9; break; }
+ if (( $(mawk 'NR==1' /DietPi/dietpi/.hw_model || mawk 'NR==1' /boot/dietpi/.hw_model) < 10 )) && dpkg-query -s kodi &> /dev/null; then
- fi
- #-------------------------------------------------------------------------------
- # Finished
- echo -e '\e[90m[\e[0m \e[32mOK\e[0m \e[90m]\e[0m Successfully applied pre-patches\n'
- break
- #-------------------------------------------------------------------------------
+ echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 17 | Pre-create /etc/polkit-1/localauthority/50-local.d to prevent Kodi upgrade failure'
+ mkdir -p /etc/polkit-1/localauthority/50-local.d
- done
+ fi
+ fi
#-------------------------------------------------------------------------------
- exit $EXIT_CODE
+ # Finished
+ exit 0
#-------------------------------------------------------------------------------
}
diff --git a/dietpi/preboot b/dietpi/preboot
index ad9b4ca91b..15d6f47f9d 100644
--- a/dietpi/preboot
+++ b/dietpi/preboot
@@ -29,6 +29,9 @@
# Apply LED triggers if set
G_THREAD_START /DietPi/dietpi/func/dietpi-led_control 1
+
+ # Disable video output on RPi when headless mode has been chosen
+ (( $G_HW_MODEL < 10 )) && grep -q '^[[:blank:]]*AUTO_SETUP_HEADLESS=1' /DietPi/dietpi.txt && tvservice -o
#-----------------------------------------------------------------------------------
G_THREAD_WAIT
exit
diff --git a/dietpi/server_version-6 b/dietpi/server_version-6
index 4d816daa2d..999697a5b0 100644
--- a/dietpi/server_version-6
+++ b/dietpi/server_version-6
@@ -1,3 +1,3 @@
6
-25
+26
3
diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash
index 2e1dba629b..4d1289e2a1 100644
--- a/rootfs/etc/bashrc.d/dietpi.bash
+++ b/rootfs/etc/bashrc.d/dietpi.bash
@@ -33,7 +33,7 @@
fi
- # Workaround if SSH client sets an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034
+ # Workaround if SSH client sets an unsupported $TERM string: https://github.com/MichaIng/DietPi/issues/2034
if [[ $SSH_TTY ]] && ! toe -a | grep -q "^$TERM[[:blank:]]"; then
TERM_old=$TERM
diff --git a/rootfs/var/lib/dietpi/dietpi-software/conf/cava.conf b/rootfs/var/lib/dietpi/dietpi-software/conf/cava.conf
index 90974c4d5f..85e3ab284b 100644
--- a/rootfs/var/lib/dietpi/dietpi-software/conf/cava.conf
+++ b/rootfs/var/lib/dietpi/dietpi-software/conf/cava.conf
@@ -1,11 +1,10 @@
## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting.
-
[general]
# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0
; mode = normal
-
+
# Accepts only non-negative values.
; framerate = 60
@@ -25,7 +24,6 @@
; bar_width = 2
; bar_spacing = 1
-
# Lower and higher cutoff frequencies for lowest and highest bars
# the bandwidth of the visualizer.
# Note: there is a minimum total bandwidth of 43Mhz x number of bars.
@@ -33,8 +31,6 @@
; lower_cutoff_freq = 50
; higher_cutoff_freq = 10000
-
-
[input]
# Audio capturing method. Possible methods are: 'pulse', 'alsa' or 'fifo'.
@@ -45,7 +41,7 @@
#
# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink
# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them).
-#
+#
# For alsa 'source' will be the capture device.
# For fifo 'source' will be the path to fifo-file.
; method = pulse
@@ -57,12 +53,10 @@
method = fifo
source = /tmp/mpd.fifo
-
-
[output]
-# Ouput method. Can be 'ncurses', 'noncurses' or 'raw'.
-# 'noncurses' is for systems that does not suport ncurses.
+# Output method. Can be 'ncurses', 'noncurses' or 'raw'.
+# 'noncurses' is for systems that do not support ncurses.
# 'raw' is a 16 bit data stream of the bar heights that can be used to send to other applications.
# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
; method = ncurses
@@ -89,8 +83,6 @@ source = /tmp/mpd.fifo
; bar_delimiter = 59
; frame_delimiter = 10
-
-
[color]
# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow.
@@ -106,15 +98,13 @@ source = /tmp/mpd.fifo
; gradient_color_1 = '#0099ff'
; gradient_color_2 = '#ff3399'
-
-
[smoothing]
# Percentage value for integral smoothing. Takes values from 0 - 100.
# Higher values means smoother, but less precise. 0 to disable.
; integral = 70
-# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable.
+# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable.
; monstercat = 1
; waves = 0;
@@ -126,7 +116,6 @@ source = /tmp/mpd.fifo
# In bar height, bars that would have been lower that this will not be drawn.
; ignore = 0
-
[eq]
# This one is tricky. You can have as much keys as you want.
diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash
index 4fea0d9f1e..696de18ebe 100755
--- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash
+++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash
@@ -75,7 +75,8 @@
sed -i '/over_voltage=/c\#over_voltage=0' /DietPi/config.txt
sed -i '/arm_freq=/c\#arm_freq=1500' /DietPi/config.txt
sed -i '/core_freq=/c\#core_freq=500' /DietPi/config.txt
- sed -i '/sdram_freq=/c\#sdram_freq=3200' /DietPi/config.txt
+ sed -i '/sdram_freq=/d' /DietPi/config.txt # Not supported on RPi4, defaults to 3200 MHz
+ G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /DietPi/config.txt # https://github.com/MichaIng/DietPi/issues/3019
fi
@@ -152,18 +153,18 @@
G_DIETPI-NOTIFY 2 "Setting Keyboard $autoinstall_keyboard. Please wait..."
G_CONFIG_INJECT 'XKBLAYOUT=' "XKBLAYOUT=\"$autoinstall_keyboard\"" /etc/default/keyboard
- #systemctl restart keyboard-setup
+ setupcon --save # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818065
fi
# Apply headless mode, if set in dietpi.txt (RPi, Odroid C1/C2)
- (( $G_HW_MODEL < 11 || $G_HW_MODEL == 12 )) && /DietPi/dietpi/func/dietpi-set_hardware headless $(grep -ci -m1 '^[[:blank:]]*AUTO_SETUP_HEADLESS=1' /DietPi/dietpi.txt)
+ (( $G_HW_MODEL < 11 || $G_HW_MODEL == 12 )) && /DietPi/dietpi/func/dietpi-set_hardware headless $(grep -cim1 '^[[:blank:]]*AUTO_SETUP_HEADLESS=1' /DietPi/dietpi.txt)
# Apply forced eth speed, if set in dietpi.txt
- /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed $(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_ETH_FORCE_SPEED=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ /DietPi/dietpi/func/dietpi-set_hardware eth-forcespeed $(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_ETH_FORCE_SPEED=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
# Set hostname
- /DietPi/dietpi/func/change_hostname "$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_HOSTNAME=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')"
+ /DietPi/dietpi/func/change_hostname "$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_HOSTNAME=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)"
# Set auto login for next bootup
grep -qi '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /DietPi/dietpi.txt && /DietPi/dietpi/dietpi-autostart 7
@@ -172,7 +173,7 @@
grep -qi '^[[:blank:]]*CONFIG_SERIAL_CONSOLE_ENABLE=0' /DietPi/dietpi.txt && /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
# Set root password?
- local root_password=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local root_password=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
if [[ $root_password ]]; then
chpasswd <<< "root:$root_password"
@@ -183,19 +184,17 @@
# Set APT mirror
local target_repo='CONFIG_APT_DEBIAN_MIRROR'
(( $G_HW_MODEL < 10 )) && target_repo='CONFIG_APT_RASPBIAN_MIRROR'
- /DietPi/dietpi/func/dietpi-set_software apt-mirror "$(grep -m1 "^[[:blank:]]*$target_repo=" /DietPi/dietpi.txt | sed 's/^[^=]*=//')"
+ /DietPi/dietpi/func/dietpi-set_software apt-mirror "$(sed -n "/^[[:blank:]]*$target_repo=/{s/^[^=]*=//p;q}" /DietPi/dietpi.txt)"
- # Generate unique Dropbear host keys:
+ # Regenerate unique Dropbear host keys:
rm -f /etc/dropbear/*_host_key
- # - Distro specific package and on Jessie, ECDSA is not created automatically
- if (( $G_DISTRO < 4 )); then
+ if (( $G_DISTRO < 6 )); then
- dpkg-reconfigure -f noninteractive dropbear
- dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
+ dpkg-reconfigure -f noninteractive dropbear-run
else
- dpkg-reconfigure -f noninteractive dropbear-run
+ dpkg-reconfigure -f noninteractive dropbear
fi
@@ -218,14 +217,14 @@
sed -i "s/wlan[0-9]/wlan$index_wlan/g" /etc/network/interfaces
# - Grab user requested settings from /dietpi.txt
- local ethernet_enabled=$(grep -ci -m1 '^[[:blank:]]*AUTO_SETUP_NET_ETHERNET_ENABLED=1' /DietPi/dietpi.txt)
- local wifi_enabled=$(grep -ci -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_ENABLED=1' /DietPi/dietpi.txt)
-
- local use_static=$(grep -ci -m1 '^[[:blank:]]*AUTO_SETUP_NET_USESTATIC=1' /DietPi/dietpi.txt)
- local static_ip=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_STATIC_IP=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local static_mask=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_STATIC_MASK=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local static_gateway=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_STATIC_GATEWAY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
- local static_dns=$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_STATIC_DNS=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
+ local ethernet_enabled=$(grep -cim1 '^[[:blank:]]*AUTO_SETUP_NET_ETHERNET_ENABLED=1' /DietPi/dietpi.txt)
+ local wifi_enabled=$(grep -cim1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_ENABLED=1' /DietPi/dietpi.txt)
+
+ local use_static=$(grep -cim1 '^[[:blank:]]*AUTO_SETUP_NET_USESTATIC=1' /DietPi/dietpi.txt)
+ local static_ip=$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_STATIC_IP=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local static_mask=$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_STATIC_MASK=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local static_gateway=$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_STATIC_GATEWAY=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
+ local static_dns=$(sed -n '/^[[:blank:]]*AUTO_SETUP_NET_STATIC_DNS=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt)
# - WiFi
if (( $wifi_enabled )); then
diff --git a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh
index 63c321c49e..e14adcbf8e 100644
--- a/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh
+++ b/rootfs/var/lib/dietpi/services/dietpi-wifi-monitor.sh
@@ -20,7 +20,7 @@
# Check for valid WiFi adapter
[[ -e /sys/class/net/$ADAPTER ]] || { echo "ERROR: No valid WiFi adapter found on interface: $ADAPTER. Exiting..."; exit 1; }
- echo "Checking connnection for: $ADAPTER via ping to default gateway every $TICKRATE seconds"
+ echo "Checking connection for: $ADAPTER via ping to default gateway every $TICKRATE seconds"
while :
do
@@ -28,7 +28,7 @@
# - Get current gateway for ping
URL_PING=$(ip r s 0.0.0.0/0 dev $ADAPTER | mawk '{print $3}')
- [[ $G_DEBUG == 1 ]] && echo "Checking connnection for: $ADAPTER via ping to $URL_PING"
+ [[ $G_DEBUG == 1 ]] && echo "Checking connection for: $ADAPTER via ping to $URL_PING"
if ping -qI $ADAPTER -c 1 $URL_PING &> /dev/null; then
[[ $G_DEBUG == 1 ]] && echo "Connection valid for: $ADAPTER"
diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh
index 9c97873159..71454e319d 100644
--- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh
+++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh
@@ -9,7 +9,7 @@
# - IDE: /dev/hd[a-z][0-9]
# - eMMC: /dev/mmcblk[0-9]p[0-9]
# - NVMe: /dev/nvme[0-9]n[0-9]p[0-9]
- TARGET_DEV=$(findmnt / -o source -n)
+ TARGET_DEV=$(findmnt -no SOURCE /)
if [[ $TARGET_DEV == '/dev/mmcblk'* || $TARGET_DEV == '/dev/nvme'* ]]; then
TARGET_PARTITION=${TARGET_DEV##*p} # /dev/mmcblk0p1 => 1
@@ -27,24 +27,19 @@
fi
- # Resize partition, only if drive actually contains a partition table
+ # Maximize partition, only if drive actually contains a partition table
if [[ $TARGET_PARTITION == [0-9] ]]; then
- # - Failsafe: Sync changes to disk before touching partitions
+ # Failsafe: Sync changes to disk before touching partitions
sync
- # - GPT detection | Modified version of ayufan-rock64 resize script
- if sfdisk $TARGET_DRIVE -l | grep -qi 'disklabel type: gpt'; then
+ # GPT detection | Modified version of ayufan-rock64 resize script: # Move GPT alternate header to end of disk
+ sfdisk $TARGET_DRIVE -l | grep -qi 'disklabel type: gpt' && sgdisk -e $TARGET_DRIVE
- # Move GPT alternate header to end of disk
- sgdisk -e $TARGET_DRIVE
+ # Maximize partition size
+ sfdisk --no-reread $TARGET_DRIVE -fN$TARGET_PARTITION <<< ',+,,,'
- fi
-
- # - Maximize partition size
- sfdisk $TARGET_DRIVE -fN$TARGET_PARTITION --no-reread <<< ',+,,,'
-
- # - Reread partition table
+ # Reread partition table
partprobe $TARGET_DRIVE
else
@@ -53,7 +48,7 @@
fi
- # Resize file system
+ # Maximize file system
resize2fs $TARGET_DEV
exit 0