mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-03-11 01:13:40 +00:00
fix: Increase maximum size for zram-resize to 4096mb
zram-generator can allocate a maximum of 4096mb
This commit is contained in:
parent
19184790aa
commit
7b06c73f3e
@ -65,16 +65,16 @@ resize-zram:
|
||||
CONFIG='/etc/systemd/zram-generator.conf'
|
||||
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//')
|
||||
echo 'Current size: '${CURRENT_SIZE}
|
||||
read -p 'Enter new size (512-2048) in megabytes (1024): ' NEW_SIZE
|
||||
read -p 'Enter new size (512-4096) in megabytes (1024): ' NEW_SIZE
|
||||
if [ -z "${NEW_SIZE//[0-9]}" ]; then
|
||||
if [ -z "${NEW_SIZE}" ]; then
|
||||
NEW_SIZE=1024
|
||||
fi
|
||||
if ((${NEW_SIZE} >= 512 && ${NEW_SIZE} <= 2048)); then
|
||||
if ((${NEW_SIZE} >= 512 && ${NEW_SIZE} <= 4096)); then
|
||||
sudo sed -i 's/zram-size='${CURRENT_SIZE}'/zram-size='${NEW_SIZE}'/g' ${CONFIG}
|
||||
echo 'Current size: '${NEW_SIZE}'. Please reboot.'
|
||||
else
|
||||
echo 'Error: Input out of range (512-2048). Running again.'
|
||||
echo 'Error: Input out of range (512-4096). Running again.'
|
||||
just resize-zram
|
||||
fi
|
||||
else
|
||||
|
@ -23,16 +23,16 @@ resize-zram:
|
||||
CONFIG='/etc/systemd/zram-generator.conf'
|
||||
CURRENT_SIZE=$(cat "${CONFIG}" | sed 's/zram-size=//')
|
||||
echo 'Current size: '${CURRENT_SIZE}
|
||||
read -p 'Enter new size (512-2048) in megabytes (1024): ' NEW_SIZE
|
||||
read -p 'Enter new size (512-4096) in megabytes (1024): ' NEW_SIZE
|
||||
if [ -z "${NEW_SIZE//[0-9]}" ]; then
|
||||
if [ -z "${NEW_SIZE}" ]; then
|
||||
NEW_SIZE=1024
|
||||
fi
|
||||
if ((${NEW_SIZE} >= 512 && ${NEW_SIZE} <= 2048)); then
|
||||
if ((${NEW_SIZE} >= 512 && ${NEW_SIZE} <= 4096)); then
|
||||
sudo sed -i 's/zram-size='${CURRENT_SIZE}'/zram-size='${NEW_SIZE}'/g' ${CONFIG}
|
||||
echo 'Current size: '${NEW_SIZE}'. Please reboot.'
|
||||
else
|
||||
echo 'Error: Input out of range (512-2048). Running again.'
|
||||
echo 'Error: Input out of range (512-4096). Running again.'
|
||||
just resize-zram
|
||||
fi
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user