Update server-setup.sh

Fixes to btrfs
This commit is contained in:
Johan S 2024-09-06 00:21:23 +02:00 committed by GitHub
parent 0aee473c50
commit 98f80d4d16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -665,11 +665,30 @@ systemctl enable NetworkManager.service
echo " NetworkManager enabled"
# @description Edit vconsole.conf and locale.conf for persistence
# Sometimes the locale and vconsole.conf files are not updated, so we need to force update them manually.
echo -ne "
-------------------------------------------------------------------------
Updating vconsole.conf and locale.conf
-------------------------------------------------------------------------
"
# Ensure /mnt is mounted and necessary directories exist
if ! mountpoint -q /mnt; then
echo "Mounting the root filesystem..."
# Mount the correct filesystem
if [[ "${FS}" == "btrfs" ]]; then
mount -o subvol=@ ${partition3} /mnt
elif [[ "${FS}" == "ext4" ]]; then
mount -t ext4 ${partition3} /mnt
elif [[ "${FS}" == "luks" ]]; then
mount -t btrfs /dev/mapper/ROOT /mnt
fi
mount -t proc /mnt/proc
mount -t sysfs /mnt/sys
mount --bind /dev /mnt/dev
fi
# Update /etc/vconsole.conf
echo "KEYMAP=${KEYMAP}" > /mnt/etc/vconsole.conf
@ -680,6 +699,12 @@ echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf
echo "Generating locales..."
arch-chroot /mnt locale-gen
# Unmount the filesystem
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys
umount /mnt
echo -ne "
-------------------------------------------------------------------------
Cleaning
@ -691,4 +716,11 @@ sed -i 's/^%wheel ALL=(ALL:ALL) NOPASSWD: ALL/# %wheel ALL=(ALL:ALL) NOPASSWD: A
# Add sudo rights
sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
echo -ne "
-------------------------------------------------------------------------
Automated Arch Linux Installer
-------------------------------------------------------------------------
Finished!
-------------------------------------------------------------------------
"
EOF