mirror of
https://github.com/tommytran732/Arch-Setup-Script
synced 2024-11-09 20:21:34 -05:00
Better control over the swapfile creation.
This commit is contained in:
parent
20f08bb9f6
commit
e520f12d9b
12
easy-arch.sh
12
easy-arch.sh
@ -113,14 +113,17 @@ sed -i -e 's,BINARIES=(),BINARIES=(/usr/bin/btrfs),g' /mnt/etc/mkinitcpio.conf
|
||||
sed -i -e 's,#COMPRESSION="zstd",COMPRESSION="zstd",g' /mnt/etc/mkinitcpio.conf
|
||||
sed -i -e 's,modconf block filesystems keyboard,keyboard keymap modconf block encrypt filesystems,g' /mnt/etc/mkinitcpio.conf
|
||||
|
||||
# Enabling LUKS in GRUB.
|
||||
# Enabling LUKS in GRUB and setting the UUID of the LUKS container.
|
||||
UUID=$(blkid $Cryptroot | cut -f2 -d'"')
|
||||
sed -i 's/#\(GRUB_ENABLE_CRYPTODISK=y\)/\1/' /mnt/etc/default/grub
|
||||
sed -i -e "s,quiet,quiet cryptdevice=UUID=$UUID:cryptroot root=$BTRFS,g" /mnt/etc/default/grub
|
||||
|
||||
# Creating a swapfile.
|
||||
echo "How much big should the swap file be? Type the size, just a number (eg: 1 = 1GB..) "
|
||||
read swap
|
||||
read -r -p "Do you want a swapfile? [y/N]? " response
|
||||
response=${response,,}
|
||||
if [[ "$response" =~ ^(yes|y)$ ]]
|
||||
then
|
||||
read -r -p "How much big should the swap file be? Type the size, just a number (eg: 1 = 1GB..): " swap
|
||||
truncate -s 0 /mnt/swap/swapfile
|
||||
chattr +C /mnt/swap/swapfile
|
||||
btrfs property set /mnt/swap/swapfile compression none
|
||||
@ -129,6 +132,9 @@ chmod 600 /mnt/swap/swapfile
|
||||
mkswap /mnt/swap/swapfile
|
||||
swapon /mnt/swap/swapfile
|
||||
echo "/swap/swapfile none swap defaults 0 0" >> /mnt/etc/fstab
|
||||
else
|
||||
break
|
||||
fi
|
||||
|
||||
# Configuring the system.
|
||||
arch-chroot /mnt /bin/bash -xe <<"EOF"
|
||||
|
Loading…
Reference in New Issue
Block a user