Correct calculation of swap file size
This commit is contained in:
parent
e7c61d3c20
commit
5b8975f6c8
@ -243,9 +243,9 @@ install() {
|
|||||||
sfdisk --delete "${install_path}" >/dev/null
|
sfdisk --delete "${install_path}" >/dev/null
|
||||||
log "info" "Wiped partitions on $(important "${install_disk}")"
|
log "info" "Wiped partitions on $(important "${install_disk}")"
|
||||||
log "info" "Securely erasing remaining data on $(important "${install_disk}")"
|
log "info" "Securely erasing remaining data on $(important "${install_disk}")"
|
||||||
# echo YES | cryptsetup open --type plain -d /dev/urandom "${install_path}" to_be_wiped > /dev/null
|
echo YES | cryptsetup open --type plain -d /dev/urandom "${install_path}" to_be_wiped > /dev/null
|
||||||
# dd bs=1M if=/dev/zero of=/dev/mapper/to_be_wiped status=progress 2> /dev/null
|
# dd bs=1M if=/dev/zero of=/dev/mapper/to_be_wiped status=progress 2> /dev/null
|
||||||
# cryptsetup close to_be_wiped
|
cryptsetup close to_be_wiped
|
||||||
log "info" "Writing new partitions to $(important "${install_disk}")"
|
log "info" "Writing new partitions to $(important "${install_disk}")"
|
||||||
(echo n
|
(echo n
|
||||||
echo
|
echo
|
||||||
@ -273,7 +273,7 @@ install() {
|
|||||||
mount "${install_path}" /mnt/boot
|
mount "${install_path}" /mnt/boot
|
||||||
local mem_amount
|
local mem_amount
|
||||||
mem_amount="$(grep MemTotal /proc/meminfo | tr -s " " | cut -d " " -f2)"
|
mem_amount="$(grep MemTotal /proc/meminfo | tr -s " " | cut -d " " -f2)"
|
||||||
mem_amount=$(( mem_amount * 3/2 ))
|
mem_amount=$(( mem_amount * 3/2 / 1000 ))
|
||||||
log "info" "Creating swap file with memory amount: $(important "${mem_amount}") mebibytes"
|
log "info" "Creating swap file with memory amount: $(important "${mem_amount}") mebibytes"
|
||||||
dd if=/dev/zero of=/mnt/swapfile bs=1M count="${mem_amount}" status=progress
|
dd if=/dev/zero of=/mnt/swapfile bs=1M count="${mem_amount}" status=progress
|
||||||
chmod 600 /mnt/swapfile
|
chmod 600 /mnt/swapfile
|
||||||
|
Loading…
Reference in New Issue
Block a user