From 0e340d6a586a385852880aaa0c4d7410313ae7ba Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:29:12 +0200 Subject: [PATCH 1/7] v6.26 + DietPi-Config | RPi: Fix I2C baudrate detection, which is a dtparam + DietPi-Config | Minor coding --- dietpi/dietpi-config | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 079224706d..0ddc14db58 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1404,19 +1404,19 @@ 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_i2cbaudrate_hz=$(grep -m1 '^[[:blank:]]*dtparam=i2c_arm_baudrate=' /DietPi/config.txt | sed 's/^.*=//') # - 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]") # USB max current - local usb_max_current_enabled=$(grep -c -m1 '^[[:blank:]]*max_usb_current=1' /DietPi/config.txt) + local usb_max_current_enabled=$(grep -cm1 '^[[: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]") @@ -1424,7 +1424,7 @@ NB: You now need to run "apt update" or "G_AGUP" once after each reboot, before # 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=$(vcgencmd otp_dump | grep -cm1 '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]") @@ -1544,7 +1544,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_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 @@ -1555,7 +1555,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": if G_WHIP_YESNO "Current setting: $rpi_usbmaxcurrent_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 + G_CONFIG_INJECT 'max_usb_current=' 'max_usb_current=1' /DietPi/config.txt REBOOT_REQUIRED=1 fi @@ -1581,7 +1581,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": G_WHIP_DEFAULT_ITEM=${rpi_i2cbaudrate_hz% kHz} 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 From e7ee07713943680e0a57ba33ccdb11087b1bdf14 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:36:46 +0200 Subject: [PATCH 2/7] v6.26 + DietPi-Set_software | RPi: Fix applying I2C baudrate, which is a dtparam --- dietpi/func/dietpi-set_hardware | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 135735c6f9..e745661baf 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1068,19 +1068,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 From 7f9bbebed0743eba2192fdcd44d5c968d46b7a78 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:41:30 +0200 Subject: [PATCH 3/7] v6.26 + DietPi-Patch | RPi: Remove invalid I2C baudrate entries from config.txt --- dietpi/patch_file | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dietpi/patch_file b/dietpi/patch_file index ce6a0dd5c0..cebde646f0 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2137,6 +2137,13 @@ A backup will be created to "/etc/mympd/mympd.conf.bak_DDMMYYY_N" from where you fi #------------------------------------------------------------------------------- + elif (( $G_DIETPI_VERSION_SUB == 25 )); then + + #------------------------------------------------------------------------------- + # RPi: Remove invalid I2C baudrate entries from dietpi.txt. Do no apply any value to preserve current system state (default): https://github.com/MichaIng/DietPi/issues/2966 + (( $G_HW_MODEL < 10 )) && sed -i '/^[[:blank:]]*i2c_arm_baudrate=/d' /DietPi/dietpi.txt + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- From 235eeec90dc77d24be7d70090ab25e2468c0c565 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:42:35 +0200 Subject: [PATCH 4/7] v6.26 + Subversion up --- dietpi/server_version-6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 index 4d816daa2d..b7583080f8 100644 --- a/dietpi/server_version-6 +++ b/dietpi/server_version-6 @@ -1,3 +1,3 @@ 6 -25 -3 +26 +0 From aaf48e9499ebf9d6aab540625881908cdce03dc5 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:43:17 +0200 Subject: [PATCH 5/7] v6.26 + DietPi-Globals | Default subversion up --- dietpi/func/dietpi-globals | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index f4b8d63d0d..ad26475181 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -43,8 +43,8 @@ # DietPi Versions/Branch G_DIETPI_VERSION_CORE=${G_DIETPI_VERSION_CORE:-6} - G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-25} - G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-3} + G_DIETPI_VERSION_SUB=${G_DIETPI_VERSION_SUB:-26} + G_DIETPI_VERSION_RC=${G_DIETPI_VERSION_RC:-0} G_GITBRANCH=${G_GITBRANCH:-master} G_GITOWNER=${G_GITOWNER:-MichaIng} [[ -f '/DietPi/dietpi/.version' && $( Date: Sun, 7 Jul 2019 16:44:58 +0200 Subject: [PATCH 6/7] v6.26 + CHANGELOG | DietPi-Config: Resolved an issue on RPi where I2C baudrate was not applied correctly, thus selection was ineffective --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 27252317a6..79f084da6c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v6.26 (XX/08/19) Bug Fixes: +- 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-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 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/XXXX From 3be3fd8d91fbf6036070ec1a47a149dd0da199a6 Mon Sep 17 00:00:00 2001 From: MichaIng <28480705+MichaIng@users.noreply.github.com> Date: Sun, 7 Jul 2019 16:53:32 +0200 Subject: [PATCH 7/7] v6.26 + RPi | config.txt: Fix incorrect I2C baudrate entry, comment it by default --- config.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.txt b/config.txt index 3da45b4351..43f7dce412 100644 --- a/config.txt +++ b/config.txt @@ -72,14 +72,14 @@ dtparam=audio=off #-------I²C------------- 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: "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-------