This repository contains a script designed to automate the installation of Arch Linux. The script takes care of partitioning the disk, formatting the filesystem, installing the base system, configuring essential settings, and setting up a desktop environment of your choice. It is tailored for UEFI systems and assumes the installation on a single drive (e.g., /dev/sda
).
- Automatic Disk Partitioning: Creates a GPT partition table, an EFI system partition, and a root partition.
- Filesystem Formatting: Formats the partitions with appropriate filesystems (FAT32 for EFI and ext4 for root).
- Base System Installation: Installs the essential base packages for Arch Linux.
- Timezone and Locale Configuration: Sets the system timezone and locale.
- Hostname and Network Configuration: Configures the hostname and network settings.
- User Creation: Creates a new user with sudo privileges.
- Bootloader Installation: Installs and configures GRUB as the bootloader.
- Desktop Environment Setup: Installs and configures a desktop environment (Plasma by default).
- Network Management: Installs and enables NetworkManager.
- Arch Linux installation medium (USB/DVD)
- Internet connection
Boot into the Arch Linux live environment and download the script using curl
:
curl -O https://raw.githubusercontent.com/kanata-05/invention-automation/main/install.sh
Change the permissions of the script to make it executable:
chmod +x install.sh
Open the script in a text editor to adjust the variables at the top to suit your preferences:
nano install.sh
You can customize the following variables:
DISK
: The target disk for installation (default:/dev/sda
)HOSTNAME
: The desired hostname for your systemUSERNAME
: The name of the new user to be createdPASSWORD
: The password for the new userROOT_PASSWORD
: The root user's passwordTIMEZONE
: Your timezone (default:America/New_York
)LOCALE
: The system locale (default:en_US.UTF-8
)KEYMAP
: The keyboard layout (default:us
)DESKTOP_ENV
: The desktop environment to install (default:plasma
)
Execute the script to start the automated installation process:
./install.sh
Once the script completes, your system will reboot into the newly installed Arch Linux environment. Log in with the user credentials you set in the script.
Below is an example of the configuration section of the script:
# Variables
DISK="/dev/sda"
HOSTNAME="archlinux"
USERNAME="user"
PASSWORD="password"
ROOT_PASSWORD="rootpassword"
TIMEZONE="America/New_York"
LOCALE="en_US.UTF-8"
KEYMAP="us"
DESKTOP_ENV="plasma"
The script performs the following steps:
- System Clock: Synchronizes the system clock with
timedatectl set-ntp true
. - Disk Partitioning: Uses
parted
to create a GPT partition table, an EFI partition, and a root partition. - Filesystem Formatting: Formats the EFI partition as FAT32 and the root partition as ext4.
- Mounting Partitions: Mounts the root partition to
/mnt
and the EFI partition to/mnt/boot
. - Base System Installation: Installs the base system using
pacstrap
. - Generating fstab: Generates the filesystem table with
genfstab
. - Chroot Configuration: Configures the system within a chroot environment:
- Sets the timezone and hardware clock.
- Configures locale settings.
- Sets the hostname and updates
/etc/hosts
. - Sets root password and creates a new user with sudo privileges.
- Installs and configures GRUB as the bootloader.
- Installs and enables NetworkManager.
- Installs and configures a desktop environment.
- Unmounting Partitions: Unmounts all partitions.
- Rebooting: Reboots the system into the newly installed Arch Linux environment.
- Review the Script: Ensure you review the script thoroughly before running it, especially if you are using it on a system with existing data.
- Customization: The script can be customized for different hardware configurations and preferences.
Contributions are welcome! If you have suggestions for improvements, additional features, or bug fixes, please submit an issue or a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
If you have any questions or need further assistance, feel free to open an issue on this repository.