2023-07-16 20:55:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
####################
|
|
|
|
# Einfache Version #
|
|
|
|
####################
|
|
|
|
|
2023-07-17 22:36:03 +00:00
|
|
|
#--------------------------#
|
|
|
|
|
|
|
|
#################
|
|
|
|
# Einstellungen #
|
|
|
|
#################
|
|
|
|
|
|
|
|
# Microcode für den Prozessor: amd-ucode|intel-ucode
|
2023-07-16 20:55:29 +00:00
|
|
|
MICROCODE="amd-ucode"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Kernel: linux|linux-lts|linux-zen
|
2023-07-16 20:55:29 +00:00
|
|
|
KERNEL="linux"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Rechnername: arch
|
2023-07-16 20:55:29 +00:00
|
|
|
HOSTNAME_NEW="arch"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Passwort für den System-Benutzer (root): testen
|
2023-07-16 20:55:29 +00:00
|
|
|
ROOTPASSWORD="testen"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Name des Benutzers: eichehome
|
2023-07-16 20:55:29 +00:00
|
|
|
USERNAME="eichehome"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Passwort für den Benutzer: testen
|
2023-07-16 20:55:29 +00:00
|
|
|
USERPASSWORD="testen"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Grafikkarte: amd|intel|nvidia
|
2023-07-16 20:55:29 +00:00
|
|
|
GRAPHICS_CARD="amd"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Zeitzone: Europe/Berlin
|
2023-07-16 20:55:29 +00:00
|
|
|
TIMEZONE="Europe/Berlin"
|
|
|
|
# language: de_DE.UTF-8
|
|
|
|
LANG="de_DE.UTF-8"
|
2023-07-17 22:36:03 +00:00
|
|
|
# Pakete:
|
|
|
|
# GNOME Programme
|
|
|
|
GNOME=(xdg-user-dirs gdm gnome-backgrounds gnome-color-manager gnome-console gnome-control-center gnome-disk-utility gnome-keyring gnome-menus gnome-remote-desktop gnome-session gnome-settings-daemon gnome-shell gnome-system-monitor gnome-tour gnome-user-docs gnome-user-share grilo-plugins gvfs gvfs-afc gvfs-goa gvfs-google gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-smb malcontent nautilus orca rygel sushi xdg-desktop-portal-gnome xdg-user-dirs-gtk yelp seahorse power-profiles-daemon)
|
|
|
|
# Ander grafische Programme
|
|
|
|
GRAPHIC_PROGRAMMS=()
|
|
|
|
# Cli-Anwendungen
|
|
|
|
CLI=(opendoas git vim lynx openssh bash-completion man-db man-pages reflector efibootmgr mtools dosfstools htop) # texinfo pacman-contrib rsync rebuild-detector
|
|
|
|
# Schriftarten
|
|
|
|
FONTS=()
|
|
|
|
# Codecs
|
|
|
|
CODECS=()
|
|
|
|
# Bluetooth
|
|
|
|
BLUETOOTH=(bluez bluez-utils)
|
|
|
|
# Office
|
|
|
|
OFFICE=(libreoffice-fresh-de)
|
|
|
|
# Audio/Video
|
|
|
|
AUDIO_VIDEO=(pipewire pipewire-audio pipewire-alsa pipewire-pulse pipewire-jack pipewire-zeroconf pipewire-v4l2 pipewire-docs pipewire-roc helvum wireplumber gstreamer gst-plugin-pipewire gst-libav gst-plugins-good gst-plugins-base)
|
|
|
|
# Drucken
|
|
|
|
PRINT=(cups)
|
|
|
|
# Development
|
|
|
|
DEV=(base-devel "${KERNEL}-headers")
|
|
|
|
# Netzwerk
|
|
|
|
NET=(iptables-nft firewalld inetutils avahi networkmanager networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc modemmanager) #iwd bind(dig,host,nslookup)
|
|
|
|
# Sontiges
|
|
|
|
OTHER=(base linux-firmware plymouth mkinitcpio xdg-utils) #dracut
|
|
|
|
# Grafik
|
|
|
|
GRAPHIC_DRIVER=()
|
|
|
|
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
|
|
|
|
GRAPHIC_DRIVER+=(xf86-video-amdgpu)
|
|
|
|
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
|
|
|
|
GRAPHIC_DRIVER+=(nvidia nvidia-utils nvidia-settings)
|
|
|
|
fi
|
|
|
|
|
2023-07-17 22:39:27 +00:00
|
|
|
# dialog
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
# Drive: /dev/vda
|
|
|
|
DRIVE="/dev/vda"
|
2023-07-17 22:36:03 +00:00
|
|
|
# disklayout: ESP (512MiB), usr (15GiB), Root (100% - [512MiB + 15GiB])
|
|
|
|
ESP="512M"
|
|
|
|
USR="15G"
|
|
|
|
|
|
|
|
#--------------------------#
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 22:36:03 +00:00
|
|
|
###############################
|
|
|
|
# Erstellen der Partitionen #
|
|
|
|
# und mounten der Partitionen #
|
|
|
|
###############################
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
#Discoverable Partitions Specification
|
2023-07-19 17:29:49 +00:00
|
|
|
# /boot /dev/vda1
|
|
|
|
# /usr /dev/vda2
|
|
|
|
# (usr-hash) /dev/vda3
|
|
|
|
# /(root) /dev/vda4
|
|
|
|
# Reset Partition Table
|
2023-07-16 20:55:29 +00:00
|
|
|
sgdisk -og "${DRIVE}"
|
2023-07-19 17:27:03 +00:00
|
|
|
# Create EFI System Partition
|
2023-07-17 22:36:03 +00:00
|
|
|
sgdisk -n 0:0:+"${ESP}" -t 0:c12a7328-f81f-11d2-ba4b-00a0c93ec93b -c 0:"EFI System Partition" "${DRIVE}"
|
2023-07-16 20:55:29 +00:00
|
|
|
#sgdisk -n 0:0:+512M -t 0:ef00 -c 0:ESP "${DRIVE}"
|
2023-07-19 17:27:03 +00:00
|
|
|
# Create usr-Partition
|
2023-07-17 22:36:03 +00:00
|
|
|
sgdisk -n 0:0:+"${USR}" -t 0:8484680c-9521-48c6-9c11-b0720656f69e -c 0:"Usr-Partition" "${DRIVE}"
|
2023-07-19 17:28:37 +00:00
|
|
|
# Create usrhash-Partition
|
|
|
|
sgdisk -n 0:0:+64M -t 0: -c 0:"usrhash-Partition" "${DRIVE}"
|
2023-07-19 17:27:03 +00:00
|
|
|
# Create Root-Partition
|
2023-07-17 19:05:44 +00:00
|
|
|
sgdisk -n 0:0:0 -t 0:4f68bce3-e8cd-4db1-96e7-fbcaf984b709 -c 0:"System Root" "${DRIVE}"
|
|
|
|
|
2023-07-16 20:55:29 +00:00
|
|
|
|
|
|
|
mkfs.vfat -n EFI -F 32 /dev/vda1
|
2023-07-17 19:05:44 +00:00
|
|
|
mkfs.ext4 -L usr /dev/vda2
|
2023-07-19 17:28:37 +00:00
|
|
|
mkfs.ext4 -L root /dev/vda4
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-19 17:30:47 +00:00
|
|
|
mount /dev/disk/by-label/root /mnt
|
2023-07-17 19:05:44 +00:00
|
|
|
mkdir -p /mnt/{boot,usr}
|
2023-07-19 17:30:47 +00:00
|
|
|
mount /dev/disk/by-label/EFI /mnt/boot
|
|
|
|
mount /dev/disk/by-label/usr /mnt/usr
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 22:36:03 +00:00
|
|
|
#--------------------------#
|
|
|
|
|
|
|
|
#######################
|
|
|
|
# Pakete installieren #
|
|
|
|
#######################
|
|
|
|
|
2023-07-17 22:39:27 +00:00
|
|
|
# Pacman im Live-System konfigurieren
|
|
|
|
sed -i 's/#\(Color\)/\1/' /etc/pacman.conf
|
|
|
|
# Umbruch notwendug
|
|
|
|
sed -i 's/#\(ParallelDownloads\s=\s5\)/\1\
|
|
|
|
ILoveCandy/' /etc/pacman.conf
|
|
|
|
|
|
|
|
pacstrap -i /mnt "${KERNEL}" "${MICROCODE}" "${GNOME[@]}" "${GRAPHIC_PROGRAMMS[@]}" "${CLI[@]}" "${FONTS[@]}" "${CODECS[@]}" "${BLUETOOTH[@]}" "${OFFICE[@]}" "${AUDIO_VIDEO[@]}" "${PRINT[@]}" "${DEV[@]}" "${NET[@]}" "${OTHER[@]}" "${GRAPHIC_DRIVER[@]}"
|
2023-07-17 22:36:03 +00:00
|
|
|
|
|
|
|
#--------------------------#
|
|
|
|
|
|
|
|
#################################
|
|
|
|
# Das neue System konfigurieren #
|
|
|
|
#################################
|
|
|
|
|
2023-07-16 20:55:29 +00:00
|
|
|
# ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime -> L /etc/localtime - - - - "/usr/share/zoneinfo/${TIMEZONE}"
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt hwclock --systohc
|
2023-07-17 11:54:11 +00:00
|
|
|
arch-chroot /mnt rm -rf /etc/localtime
|
|
|
|
arch-chroot /mnt ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/#\(Color\)/\1/' /mnt/etc/pacman.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
# Umbruch notwendug
|
|
|
|
sed -i 's/#\(ParallelDownloads\s=\s5\)/\1\
|
2023-07-16 22:01:36 +00:00
|
|
|
ILoveCandy/' /mnt/etc/pacman.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i "s/#\(${LANG}\)/\1/" /mnt/etc/locale.gen
|
|
|
|
arch-chroot /mnt locale-gen
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
echo "LANG=${LANG}" > /mnt/etc/locale.conf
|
|
|
|
echo "KEYMAP=${KEYMAP}" > /mnt/etc/vconsole.conf
|
|
|
|
echo "${HOSTNAME_NEW}" > /mnt/etc/hostname
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/hosts << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
127.0.0.1 localhost
|
|
|
|
::1 localhost
|
|
|
|
EOF
|
|
|
|
#echo "127.0.0.1 localhost" > /etc/hosts
|
|
|
|
#echo "::1 localhost" >> /etc/hosts
|
|
|
|
#echo "127.0.1.1 ${HOSTNAME_NEW}.localedomain ${HOSTNAME_NEW}" >> /etc/hosts
|
2023-07-17 22:36:03 +00:00
|
|
|
|
2023-07-16 22:04:52 +00:00
|
|
|
arch-chroot /mnt chpasswd <<< "root:${ROOTPASSWORD}"
|
|
|
|
#echo root:"${ROOTPASSWORD}" | chpasswd
|
2023-07-17 22:36:03 +00:00
|
|
|
arch-chroot /mnt useradd -mG wheel "${USERNAME}"
|
|
|
|
arch-chroot /mnt chpasswd <<< "${USERNAME}:${USERPASSWORD}"
|
|
|
|
#echo "${USERNAME}:${USERPASSWORD}" | chpasswd
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 19:10:45 +00:00
|
|
|
#cat > /etc/NetworkManager/conf.d/wifi_backend.conf << EOF
|
|
|
|
#[device]
|
|
|
|
#wifi.backend=iwd
|
|
|
|
#EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/#\(CHARACTER_SET:\).*/\1utf-8/' /mnt/etc/lynx.cfg
|
2023-07-16 22:43:39 +00:00
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 19:06:52 +00:00
|
|
|
# Tastatur layout auf Deutsch stellen
|
2023-07-17 22:51:57 +00:00
|
|
|
arch-chroot /mnt gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'de')]"
|
2023-07-17 19:06:52 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/xdg/reflector/reflector.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
--save /etc/pacman.d/mirrorlist
|
|
|
|
--country Germany
|
|
|
|
--protocol https
|
|
|
|
--latest 5
|
|
|
|
EOF
|
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/doas.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
permit :wheel
|
|
|
|
permit persist eichehome as root
|
|
|
|
EOF
|
|
|
|
#echo "permit :wheel" > /etc/doas.conf
|
|
|
|
#echo "permit persist eichehome as root" >> /etc/doas.conf
|
|
|
|
#echo "" >> /etc/doas.conf
|
2023-07-16 22:43:39 +00:00
|
|
|
arch-chroot /mnt doas -C /etc/doas.conf && echo "config ok" || echo "config error"
|
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 11:56:54 +00:00
|
|
|
mkdir -p /mnt/etc/systemd/resolved.conf.d
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/etc/systemd/resolved.conf.d/disable-multicastDNS.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
[Resolve]
|
|
|
|
MulticastDNS=no
|
|
|
|
EOF
|
2023-07-16 22:43:39 +00:00
|
|
|
sleep 2
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt systemctl enable systemd-resolved
|
|
|
|
arch-chroot /mnt systemctl enable systemd-timesyncd
|
2023-07-17 12:16:59 +00:00
|
|
|
arch-chroot /mnt systemctl enable NetworkManager
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt systemctl enable reflector.timer
|
|
|
|
arch-chroot /mnt systemctl enable firewalld
|
|
|
|
arch-chroot /mnt systemctl enable fstrim.timer
|
|
|
|
arch-chroot /mnt systemctl enable gdm
|
|
|
|
arch-chroot /mnt systemctl enable avahi-daemon
|
|
|
|
arch-chroot /mnt systemctl enable bluetooth
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 22:36:03 +00:00
|
|
|
#--------------------------#
|
|
|
|
|
|
|
|
########################################
|
|
|
|
# Initramfs konfigurieren und erzeugen #
|
|
|
|
########################################
|
|
|
|
|
2023-07-16 22:28:08 +00:00
|
|
|
if [[ "${GRAPHICS_CARD}" == "amd" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(amdgpu)/' /mnt/etc/mkinitcpio.conf #AMD
|
2023-07-16 22:28:08 +00:00
|
|
|
elif [[ "${GRAPHICS_CARD}" == "intel" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(i915)/' /mnt/etc/mkinitcpio.conf #Intel
|
2023-07-16 22:28:08 +00:00
|
|
|
elif [[ "${GRAPHICS_CARD}" == "nvidia" ]]; then
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/MODULES=()/MODULES=(nvidia)/' /mnt/etc/mkinitcpio.conf #Nvidia
|
2023-07-16 20:55:29 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
sed -i 's/^HOOKS=(.*)/HOOKS=(base systemd keyboard plymouth autodetect sd-vconsole modconf kms block filesystems fsck)/' /mnt/etc/mkinitcpio.conf
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt mkinitcpio -p "${KERNEL}"
|
2023-07-16 20:55:29 +00:00
|
|
|
|
2023-07-17 22:36:03 +00:00
|
|
|
#--------------------------#
|
|
|
|
|
|
|
|
#############################################
|
|
|
|
# Bootloader installieren und konfigurieren #
|
|
|
|
#############################################
|
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
arch-chroot /mnt bootctl install
|
2023-07-17 22:36:03 +00:00
|
|
|
|
2023-07-16 21:58:36 +00:00
|
|
|
cat > /mnt/boot/loader/loader.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
timeout 5
|
|
|
|
console-mode max
|
|
|
|
editor yes
|
|
|
|
default *
|
|
|
|
EOF
|
2023-07-17 22:36:03 +00:00
|
|
|
|
2023-07-16 22:01:36 +00:00
|
|
|
cat > /mnt/boot/loader/entries/arch.conf << EOF
|
2023-07-16 20:55:29 +00:00
|
|
|
title Arch Linux
|
|
|
|
version 0.1
|
|
|
|
linux /vmlinuz-${KERNEL}
|
|
|
|
initrd /${MICROCODE}.img
|
|
|
|
initrd /initramfs-${KERNEL}.img
|
|
|
|
options quiet rw
|
|
|
|
EOF
|
|
|
|
|
2023-07-16 22:44:52 +00:00
|
|
|
umount -R /mnt
|
|
|
|
|
2023-07-16 22:28:45 +00:00
|
|
|
exit 0
|