Skip to content

Commit

Permalink
v8.10
Browse files Browse the repository at this point in the history
- Init v8.10
- DietPi-Drive_Manager | Resolved an issue where it was not possible to disable the swap file with less than 2 GiB available free space on that drive. The check was meant to prevent the creation of a swap file with limited free space, while disabling/removing a swap file should of course always be possible. Furthermore the 2 GiB free space requirement has been removed completely, which has no point on non-system drives and is too strict even on system drives which, depending on the setup, can run fine with much less free space. Many thanks to @symbios24 for reporting this issue: #5749 (comment)
  • Loading branch information
MichaIng committed Sep 25, 2022
1 parent ce358db commit ab9523f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,16 @@ shopt -s extglob

aSOFTWARE_NAME8_8=()
aSOFTWARE_NAME8_9=()
aSOFTWARE_NAME8_10=()
for i in "${!aSOFTWARE_NAME8_7[@]}"
do
aSOFTWARE_NAME8_8[$i]=${aSOFTWARE_NAME8_7[$i]}
aSOFTWARE_NAME8_9[$i]=${aSOFTWARE_NAME8_8[$i]}
aSOFTWARE_NAME8_10[$i]=${aSOFTWARE_NAME8_9[$i]}
done

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME8_9[@]}"
for i in "${aSOFTWARE_NAME8_10[@]}"
do
aSOFTWARE["$i"]=0
done
Expand Down
4 changes: 2 additions & 2 deletions .update/version
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# shellcheck disable=SC2034
# Available DietPi version
G_REMOTE_VERSION_CORE=8
G_REMOTE_VERSION_SUB=9
G_REMOTE_VERSION_RC=2
G_REMOTE_VERSION_SUB=10
G_REMOTE_VERSION_RC=-1
# Minimum DietPi version to allow update
G_MIN_VERSION_CORE=6
G_MIN_VERSION_SUB=14
Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
v8.10
(2022-10-22)

Enhancements:

Bug fixes:
- DietPi-Drive_Manager | Resolved an issue where it was not possible to disable the swap file with less than 2 GiB available free space on that drive. The check was meant to prevent the creation of a swap file with limited free space, while disabling/removing a swap file should of course always be possible. Furthermore the 2 GiB free space requirement has been removed completely, which has no point on non-system drives and is too strict even on system drives which, depending on the setup, can run fine with much less free space. Many thanks to @symbios24 for reporting this issue: https://github.com/MichaIng/DietPi/issues/5749#issuecomment-1257169750

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

For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues

-----------------------------------------------------------------------------------------------------------

v8.9
(2022-09-24)

Expand All @@ -21,8 +35,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/5760

For all additional issues that may appear after release, please see the following link for active tickets: https://github.com/MichaIng/DietPi/issues

-----------------------------------------------------------------------------------------------------------

v8.8
Expand Down
42 changes: 16 additions & 26 deletions dietpi/dietpi-drive_manager
Original file line number Diff line number Diff line change
Expand Up @@ -1065,15 +1065,12 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
local swapfile_size=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SWAPFILE_SIZE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt)
if (( $swapfile_size > 0 )) &&
{ [[ $FP_SWAPFILE_CURRENT == ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}* && ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} != '/' ]] ||
[[ $FP_SWAPFILE_CURRENT == '/var/swap' && ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} == '/' ]]; }; then

[[ $FP_SWAPFILE_CURRENT == '/var/swap' && ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} == '/' ]]; }
then
partition_contains_swapfile=1
G_WHIP_MENU_ARRAY+=('Swap file' ": [X] | ${swapfile_size} MiB used on this drive, select to change size")

else

G_WHIP_MENU_ARRAY+=('Swap file' ': [ ] | Select to transfer swapfile to this drive')

fi

fi
Expand Down Expand Up @@ -1212,37 +1209,30 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return
elif [[ $G_WHIP_RETURNED_VALUE == 'Swap file' ]]; then

local min=0
local current_freespace=$(G_CHECK_FREESPACE "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}")
local max=$(( $current_freespace - 2000 ))
if [[ ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} == 'btrfs' ]]; then

local current=0
[[ $partition_contains_swapfile && -f $FP_SWAPFILE_CURRENT ]] && current=$(( $(stat -c '%s' "$FP_SWAPFILE_CURRENT") / 1024**2 ))
local max=$$(( (G_CHECK_FREESPACE "${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}") + ${current:=0} ))
if [[ ${aDRIVE_FSTYPE[$MENU_DRIVE_INDEX]} == 'btrfs' ]]
then
G_WHIP_MSG '[FAILED] The filesystem Btrfs does not support swap files.\n
Please choose another drive or format this one with another filesystem, e.g. ext4.'

elif (( $max < $min )); then

G_WHIP_MSG "[FAILED] Insufficient free space on ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}, a minimum of 2GB is required ($current_freespace MiB available)."

else

G_WHIP_DEFAULT_ITEM=$swapfile_size
if G_WHIP_INPUTBOX "Please input a new value for swap file size (MiB):
\nSwap file has a swappiness setting of 1, and, is used only to prevent out of memory errors.
\n - Recommended value = 1 (auto)\n - 0 = Disable swap file\n - 1 = Auto size swap file (2GB - RAM = size)\n - 2 - $max = Manual size"; then

if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" "$min" "$max"; then

G_WHIP_DEFAULT_ITEM=${current:-$swapfile_size}
if G_WHIP_INPUTBOX "Please enter a new size for the swap file on this drive [MiB]:
\nSwap space has a swappiness setting of 1 and is hence used to prevent out of memory errors only.
\n - 0 = Disable swap file\n - 1 = Auto size: 2 GiB minus physical RAM size, recommend!\n - 2 and above = Manual size
\nEnter a value between $min and $max, based on available space.\n - Current: $current"
then
if G_CHECK_VALIDINT "$G_WHIP_RETURNED_VALUE" "$min" "$max"
then
local fp_target_swapfile="${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]}/.swapfile"
[[ ${aDRIVE_MOUNT_TARGET[$MENU_DRIVE_INDEX]} == '/' ]] && fp_target_swapfile='/var/swap'

(( $SERVICES_STOPPED )) || { /boot/dietpi/dietpi-services stop; SERVICES_STOPPED=1; }
/boot/dietpi/func/dietpi-set_swapfile "$G_WHIP_RETURNED_VALUE" "$fp_target_swapfile"
/boot/dietpi/func/dietpi-set_swapfile "$G_WHIP_RETURNED_VALUE" "$fp_target_swapfile" || read -rp " - Press any key to return to $G_PROGRAM_NAME..."
FP_SWAPFILE_CURRENT=$fp_target_swapfile

fi

fi

fi

elif [[ $G_WHIP_RETURNED_VALUE == 'Reserved blocks' ]]; then
Expand Down
3 changes: 1 addition & 2 deletions dietpi/dietpi-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@
fi

# Wait for user input
[[ $error == 1 || $command == 'dietpi-cpuinfo' || $command == 'dietpi-update' || $command == 'dietpi-morsecode' ]] && read -rp "
- Press any key to return to $G_PROGRAM_NAME..."
[[ $error == 1 || $command == 'dietpi-cpuinfo' || $command == 'dietpi-update' || $command == 'dietpi-morsecode' ]] && read -rp " - Press any key to return to $G_PROGRAM_NAME..."

else
G_WHIP_SIZE_X_MAX=50
Expand Down
4 changes: 2 additions & 2 deletions dietpi/func/dietpi-globals
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
[[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version
# - Assign defaults/code version as fallback
[[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8
[[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=9
[[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2
[[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=10
[[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1
[[ $G_GITBRANCH ]] || G_GITBRANCH='master'
[[ $G_GITOWNER ]] || G_GITOWNER='MichaIng'
# - Save current version and Git branch
Expand Down

0 comments on commit ab9523f

Please sign in to comment.