mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-22 15:11:04 +01:00
Optimized creation of of swap for multiple setup runs
This commit is contained in:
parent
78cd0cbed9
commit
6c3734a63b
@ -10,12 +10,19 @@ echo "Copying templates to home folder..."
|
|||||||
cp -rfv "$TEMPLATE_PATH/." "$HOME"
|
cp -rfv "$TEMPLATE_PATH/." "$HOME"
|
||||||
echo "Synchronising packages..."
|
echo "Synchronising packages..."
|
||||||
sudo pacman -Syyu
|
sudo pacman -Syyu
|
||||||
echo "Creating swap partition..."
|
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
|
||||||
sudo fallocate -l 16G /swapfile
|
SWAP_FILE="/swapfile"
|
||||||
sudo chmod 600 /swapfile
|
FSTAB_FILE="/etc/fstab"
|
||||||
sudo mkswap /swapfile
|
if grep -q "$FSTAB_SWAP_ENTRY" "$FSTAB_FILE"; then
|
||||||
sudo swapon /swapfile
|
echo "Skipping creation of swap partion because entry allready exists in <<$FSTAB_FILE>>!"
|
||||||
sudo echo "/swapfile none swap defaults 0 0">>/etc/fstab
|
else
|
||||||
|
echo "Creating swap partition..."
|
||||||
|
sudo fallocate -l 16G "$SWAP_FILE"
|
||||||
|
sudo chmod 600 "$SWAP_FILE"
|
||||||
|
sudo mkswap "$SWAP_FILE"
|
||||||
|
sudo swapon "$SWAP_FILE"
|
||||||
|
sudo echo "$FSTAB_SWAP_ENTRY">>"$FSTAB_FILE"
|
||||||
|
fi
|
||||||
echo "Synchronizing programing language interpreters..."
|
echo "Synchronizing programing language interpreters..."
|
||||||
sudo pacman --needed -S jdk11-openjdk python php
|
sudo pacman --needed -S jdk11-openjdk python php
|
||||||
echo "Synchronizing compression tools..."
|
echo "Synchronizing compression tools..."
|
||||||
|
Loading…
Reference in New Issue
Block a user