Change swapfile creation
This commit is contained in:
parent
c848e2c446
commit
903b757f57
11
installer
11
installer
@ -6,7 +6,7 @@
|
|||||||
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due
|
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due
|
||||||
|
|
||||||
# shellcheck disable=SC2086,SC2046,SC2254,SC2164
|
# shellcheck disable=SC2086,SC2046,SC2254,SC2164
|
||||||
VER=2.1.60
|
VER=2.1.61
|
||||||
|
|
||||||
# default values {
|
# default values {
|
||||||
|
|
||||||
@ -1152,11 +1152,16 @@ part_find()
|
|||||||
part_swap()
|
part_swap()
|
||||||
{
|
{
|
||||||
local swp="$1"
|
local swp="$1"
|
||||||
|
local size=0
|
||||||
|
|
||||||
if [[ $swp == "$MNT/swapfile" && $SWAP_S ]]; then
|
if [[ $swp == "$MNT/swapfile" && $SWAP_S ]]; then
|
||||||
msg "Swap Setup" "\nActivating $SWAP_S swapfile at /swapfile\n" 1
|
msg "Swap Setup" "\nActivating $SWAP_S swapfile at /swapfile\n" 1
|
||||||
fallocate -l $SWAP_S "$swp" 2> "$ERR"
|
case "${SWAP_S: -1}" in
|
||||||
errshow 0 "fallocate -l '$SWAP_S' '$swp'"
|
G) size=$(( ${SWAP_S:0:-1} * 1024 )) ;;
|
||||||
|
M) size=${SWAP_S:0:-1} ;;
|
||||||
|
esac
|
||||||
|
dd if=/dev/zero of="$swp" bs=1M count=$size
|
||||||
|
errshow 0 "dd if=/dev/zero of='$swp' bs=1M count=$size"
|
||||||
chmod 600 "$swp" 2> "$ERR"
|
chmod 600 "$swp" 2> "$ERR"
|
||||||
errshow 0 "chmod 600 '$swp'"
|
errshow 0 "chmod 600 '$swp'"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user