Compare commits

3 Commits

Author SHA1 Message Date
72dabbdf96 Update install.sh
Add timezone Europe/Berlin
2025-06-18 09:36:05 +02:00
6b3545f865 Add set timezone 2025-06-17 14:12:26 +02:00
0dc59d2002 Update README.md 2025-05-29 00:44:01 +02:00
2 changed files with 74 additions and 101 deletions

View File

@ -4,7 +4,7 @@
This installation script aims for a simple (read minimal) Arch Linux installation, which is modern in the way that it uses UEFI, systemd-boot and Wayland, secure in the way that it uses full-disk encryption using LUKS as well as flexibility by using Btrfs subvolumes for the root and home partition.
Tested and working as of **February 2025**.
Tested and working as of **May 2025**.
![Post-install screenshot.](img/screenshot.png)

View File

@ -8,12 +8,6 @@ exec 2>&1
clear
# Check root
if [[ $(id -u) -ne 0 ]]; then
echo "This script needs to be run as root!"
exit 1
fi
# Friendly introduction.
echo "0. WELCOME"
echo "Welcome to the Arch Linux installation script!"
@ -52,21 +46,6 @@ IFS=' '
array=(${dev})
dev="${array[0]}"
# TODO Check disk size
# Disk auswählen (Variable `dev` muss gesetzt sein)
#disk="/dev/${dev}"
# Festplattengröße in Gigabyte berechnen
#disk_size=$(lsblk -b -n -o SIZE "$disk" | awk '{print $1 / 1024 / 1024 / 1024}')
# Prüfen, ob die Festplatte größer als 10 GB ist
#if (( $(echo "$disk_size >= 10" | bc -l) )); then
# echo "✅ Die Festplatte hat $disk_size GB und ist größer als 10 GB."
#else
# echo "❌ Fehler: Die Festplatte ist zu klein ($disk_size GB). Bitte eine größere auswählen."
# exit 1
#fi
clear
echo "2. ENCRYPTION"
@ -74,14 +53,14 @@ echo
# Setting encryption password.
echo "Choose a strong password for encrypting the primary partition:"
password_encrypt=""
while [[ -z "${password_encrypt}" ]]; do
#echo "Please enter a password: "
read -rs -p "Please enter a password: " password_first
read -rs -p "Retype a password: " password_second
if [[ "${password_first}" == "${password_second}" ]];
pwcr=""
while [[ -z "${pwcr}" ]]; do
echo "Please enter a password: "
read -rs pwfr
read -rs -p "Retype a password: " pwsc
if [[ "${pwfr}" == "${pwsc}" ]];
then
password_encrypt="${password_first}"
pwcr="${pwfr}"
echo
echo "Both passwords are the same. Continuing.."
break
@ -97,29 +76,25 @@ clear
echo "3. HOSTNAME"
echo
# Setting hostname
#echo "Before installing the system, please enter a hostname:"
read -r -p "Before installing the system, please enter a hostname: " host
while [[ -z "${host}" ]]; do
echo "Hostname can not be empty!"
read -r -p "Please enter a hostname: " host
done
# Setting hostname.
echo "Before installing the system, please enter a hostname:"
read -r host
clear
echo "4. ROOT PASSWORD"
echo
# Setting root password
# Setting root password.
echo "Choose a password for the root account:"
password_root=""
while [[ -z "${password_root}" ]]; do
#echo "Please enter a password: "
read -rs -p "Please enter a password: " password_first
read -rs -p "Retype a password: " password_second
pwr=""
while [[ -z "${pwr}" ]]; do
echo "Please enter a password: "
read -rs pwfr
read -rs -p "Retype a password: " pwsc
if [[ "${password_first}" == "${password_second}" ]]; then
password_root="${password_first}"
if [[ "${pwfr}" == "${pwsc}" ]]; then
pwrt="${pwfr}"
echo
echo "Both passwords are the same. Continuing.."
break
@ -136,26 +111,21 @@ echo "4. USER"
echo
# Setting username
#echo "Please enter a username:"
read -r -p "Please enter a username: " user
while [[ -z "${user}" ]]; do
echo "Benutzername darf nicht leer sein!"
read -r -p "Please enter a username: " user
done
echo "Please enter a username:"
read -r user
echo
# Setting user password.
echo "Also please choose a password for your user:"
password_user=""
while [[ -z "${password_user}" ]]; do
#echo "Please enter a password: "
read -rs -p "Please enter a password: " password_first
read -rs -p "Retype a password: " password_second
pwu=""
while [[ -z "${pwu}" ]]; do
echo "Please enter a password: "
read -rs pwfr
read -rs -p "Retype a password: " pwsc
if [[ "${password_first}" == "${password_second}" ]];
if [[ "${pwfr}" == "${pwsc}" ]];
then
password_user="${password_first}"
pwur="${pwfr}"
echo
echo "Both passwords are the same. Continuing.."
break
@ -210,14 +180,14 @@ fi
# Encrypting partition.
echo "Encrypting system partition. This might take a while."
echo
echo -en "${password_encrypt}\n${password_encrypt}" | cryptsetup -c aes-xts-plain -s 512 luksFormat "/dev/${main}"
echo -en "${pwcr}\n${pwcr}" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$main
echo "Partition successfully encrypted."
echo
# Opening encrypted partition and mounting at /dev/mapper/main.
echo "Decrypting.. This also might take a while."
echo
echo -en "${password_encrypt}\n${password_encrypt}" | cryptsetup luksOpen "/dev/${main}" main
echo -en "${pwcr}\n${pwcr}" | cryptsetup luksOpen "/dev/${main}" main
echo "Partition successfully opened."
echo
@ -244,7 +214,6 @@ mount "/dev/mapper/main" "/mnt"
btrfs subvolume create "/mnt/root"
btrfs subvolume create "/mnt/home"
sync
umount "/mnt"
echo
@ -277,53 +246,53 @@ echo
# Installing base system.
echo "Installing basic packages.."
# Basis-Pakete
# Base packages
base_packages=(
base
btrfs-progs
base # Arch Linux Base
btrfs-progs # Btrfs
firefox
konsole
konsole # Terminal
linux
linux-firmware
linux-zen
nano
nano # Editor
networkmanager
sddm
sddm-kcm
sddm # Display Manager
sddm-kcm # KConfig module
sudo
xorg-xwayland
plasma-desktop
plasma-nm
plasma-nm # Network manager applet
)
# Notwendige Plasma-Integrationen
# Necessary Plasma integrations
plasma_integrations=(
plasma-pa
breeze-gtk
kde-gtk-config
kdeplasma-addons
kscreen
plasma-pa # Audio applet
breeze-gtk # Widget theme
kde-gtk-config # Syncs KDE settings to GTK applications
kdeplasma-addons # Misc addons: https://github.com/KDE/kdeplasma-addons
kscreen # Adds screen management to settings
plasma-browser-integration
powerdevil
powerdevil # Power management
)
# KDE Utilities
kde_utils=(
ark
bluedevil
discover
dolphin
filelight
gwenview
kate
kcalc
kdeconnect
kinfocenter
kmag
ark # Archiving tool
bluedevil # Bluetooth
discover # GUI package management
dolphin # File browser
filelight # Disk usage analyzer
gwenview # Image viewer
kate # Text editor
kcalc # Calculator
kdeconnect # Mobile synchronisation tool
kinfocenter # System information
#kmag # Doesn't work on Wayland
plasma-systemmonitor
okular
partitionmanager
spectacle
okular # PDF viewer
partitionmanager # partitioning utility
spectacle # Screenshot utility
)
# Additional default software
@ -335,7 +304,7 @@ default_software=(
wireplumber
)
# Alle Pakete zusammenführen
# Put all packages together
all_packages=(
"${base_packages[@]}"
"${plasma_integrations[@]}"
@ -343,25 +312,32 @@ all_packages=(
"${default_software[@]}"
)
# Pakete installieren
# Install packages
pacstrap "/mnt" "${all_packages[@]}"
echo "Base system installed."
echo
# Generating fstab.
# Generating fstab
echo "Generating fstab.."
genfstab -Up "/mnt" > "/mnt/etc/fstab"
echo "Done."
echo
# Setting hostname.
# Setting timezone
echo "Setting timezone.."
arch-chroot "/mnt" ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
arch-chroot "/mnt" hwclock --systohc
echo "Done."
echo
# Setting hostname
echo "Setting hostname.."
echo "${host}" > "/mnt/etc/hostname"
echo "Done."
echo
# Setting locale.
# Setting locale
echo "Setting and generating locale.."
cat << EOF > "/mnt/etc/locale.gen"
en_US.UTF-8 UTF-8
@ -397,8 +373,7 @@ echo
# Editing mkinitcpio.conf.
echo "Editing /etc/mkinitcpio.conf.."
sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect microcode modconf kms block keyboard keymap encrypt filesystems fsck shutdown)/' /mnt/etc/mkinitcpio.conf
#sed -i '55s/.*/HOOKS=(base udev autodetect microcode modconf kms block keyboard keymap encrypt filesystems fsck shutdown)/' /mnt/etc/mkinitcpio.conf
sed -i '55s/.*/HOOKS=(base udev autodetect microcode modconf kms block keyboard keymap encrypt filesystems fsck shutdown)/' /mnt/etc/mkinitcpio.conf
echo "Done."
echo
@ -419,7 +394,7 @@ echo
# Set root password
echo "Setting root password.."
echo -en "${password_root}\n${password_root}" | arch-chroot "/mnt" passwd
echo -en "${pwrt}\n${pwrt}" | arch-chroot "/mnt" passwd
echo "Done."
echo
@ -468,7 +443,7 @@ echo
# Set username, password and group.
echo "Adding user.."
arch-chroot /mnt useradd -m "${user}"
echo -en "${password_user}\n${password_user}" | arch-chroot /mnt passwd "${user}"
echo -en "${pwur}\n${pwur}" | arch-chroot /mnt passwd "${user}"
arch-chroot /mnt gpasswd -a "${user}" wheel
sed -i '82s/.*/%wheel ALL=(ALL) ALL/' /mnt/etc/sudoers
echo "Done."
@ -506,9 +481,7 @@ EOF
# Unmounting and rebooting.
echo "Unmounting system.."
sync
umount "/mnt/boot"
umount "/mnt/home"
umount "/mnt"
echo "Done."
echo