diff --git a/src/commands/system-setup/arch/server-setup.sh b/src/commands/system-setup/arch/server-setup.sh index b498790e..7e735d17 100755 --- a/src/commands/system-setup/arch/server-setup.sh +++ b/src/commands/system-setup/arch/server-setup.sh @@ -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