live-bootstrap/steps/improve/swap.sh
Gábor Stefanik c6657b9f93 Support swap files in qemu or bare-metal mode
This can help alleviate memory pressure when bootstrapping
with high core counts.
2024-01-02 00:14:00 +01:00

19 lines
323 B
Bash

#!/bin/sh
#
# SPDX-FileCopyrightText: 2024 Gábor Stefanik <netrolller.3d@gmail.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Set up swap
. /steps/bootstrap.cfg
. /steps/env
if ! test -f /swap
then
echo "Making swap..."
dd if=/dev/zero of=/swap bs=1M count=${SWAP_SIZE}
mkswap /swap
fi
swapon /swap