diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 08c8657b15..d08da9e32b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,15 @@ +v8.21 +(2023-07-26) + +Enhancements: + +Bug fixes: +- DietPi-Set_swapfile | Resolved an issue on Bookworm systems where zram swap space was not enabled automatically on boot due to missing syscall permissions. Many thanks to @magicfoxt-magicfox for reporting this issue: https://github.com/MichaIng/DietPi/issues/6511 + +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 + +----------------------------------------------------------------------------------------------------------- + v8.20 (2023-07-29) diff --git a/dietpi/func/dietpi-set_swapfile b/dietpi/func/dietpi-set_swapfile index 2423461285..12da8888d6 100755 --- a/dietpi/func/dietpi-set_swapfile +++ b/dietpi/func/dietpi-set_swapfile @@ -88,6 +88,8 @@ # zram-swap [[ -f '/etc/modules-load.d/dietpi-zram-swap.conf' ]] && rm -v /etc/modules-load.d/dietpi-zram-swap.conf [[ -f '/etc/udev/rules.d/98-dietpi-zram-swap.rules' ]] && rm -v /etc/udev/rules.d/98-dietpi-zram-swap.rules + [[ -f '/etc/systemd/system/systemd-udevd.service.d/dietpi-zram.conf' ]] && rm -v /etc/systemd/system/systemd-udevd.service.d/dietpi-zram.conf + [[ -d '/etc/systemd/system/systemd-udevd.service.d' ]] && rmdir -v --ignore-fail-on-non-empty /etc/systemd/system/systemd-udevd.service.d } @@ -108,9 +110,12 @@ G_EXEC mkswap "$SWAP_PATH" G_EXEC swapon "$SWAP_PATH" # Make persistent, proceed with failure in case of R/O rootfs - G_EXEC_NOHALT=1 G_EXEC eval "echo 'zram' > /etc/modules-load.d/dietpi-zram-swap.conf" || return 1 - G_EXEC_NOHALT=1 G_EXEC eval "echo 'SUBSYSTEM==\"block\", KERNEL==\"zram0\", ACTION==\"add\", ATTR{disksize}=\"${SWAP_SIZE}M\", RUN+=\"chmod 0600 /dev/zram0\", RUN+=\"/sbin/mkswap /dev/zram0\", RUN+=\"/sbin/swapon /dev/zram0\"' > /etc/udev/rules.d/98-dietpi-zram-swap.rules" || return 1 - G_EXEC_NOHALT=1 G_EXEC eval "echo 'swappiness=50' > /etc/sysctl.d/98-dietpi-zram-swap.conf" || return 1 + G_EXEC_NOHALT=1 G_EXEC eval 'echo '\''zram'\'' > /etc/modules-load.d/dietpi-zram-swap.conf' || return 1 + G_EXEC_NOHALT=1 G_EXEC eval "echo 'SUBSYSTEM==\"block\", KERNEL==\"zram0\", ACTION==\"add\", ATTR{disksize}==\"0\", ATTR{disksize}=\"${SWAP_SIZE}M\", RUN+=\"/bin/chmod 0600 /dev/zram0\", RUN+=\"/sbin/mkswap /dev/zram0\", RUN+=\"/sbin/swapon /dev/zram0\"' > /etc/udev/rules.d/98-dietpi-zram-swap.rules" || return 1 + G_EXEC_NOHALT=1 G_EXEC eval 'echo '\''swappiness=50'\'' > /etc/sysctl.d/98-dietpi-zram-swap.conf' || return 1 + # Bookworm: Permit udev to run swapon: https://github.com/MichaIng/DietPi/issues/6511 + G_EXEC_NOHALT=1 G_EXEC mkdir -p /etc/systemd/system/systemd-udevd.service.d + G_EXEC_NOHALT=1 G_EXEC eval 'echo -e '\''[Service]\nSystemCallFilter=@swap'\'' > /etc/systemd/system/systemd-udevd.service.d/dietpi-zram.conf' return 0 # Swap file pre-allocation: Try faster and less write-intense fallocate first and dd as fallback